I’m trying to send information to an endpoint in a microservice within a container from a Camel service also in a container, but I’m encountering this error that I don’t know how to solve.
DefaultErrorHandler ERROR Failed delivery for (MessageId: B785993430958A9-0000000000000000 on ExchangeId: B785993430958A9-0000000000000000). Exhausted after delivery attempt: 1 caught: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4545 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
restConfiguration()
.component("netty-http")
.host("")
.port(7575);
rest("/card")
.post("/saveCard")
.consumes("application/json")
.type(DataPayCardDTO.class)
.to("direct:saveCard");
from("direct:saveCard")
.log("Received POST request: ${body}")
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
.process(new CardProcessor())
/* .unmarshal(new JacksonDataFormat(DataPayCardDTO.class)) */
.log("processing message: ${body}")
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.to("http://localhost:4545/card/CardSave?bridgeEndpoint=true");
If anyone knows how to solve this error, I would appreciate it
New contributor
Erwin Sot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.