Susanna Michael
Susanna Michael

Reputation: 161

no content to map due to end of input - In Camel

I am new to using Camel. I am getting expected response from the url i hit - which i have logged. But after receiving the message I get the error following error while unmarshalling it:

On delivery attempt: 0 caught: com.fasterxml.json.databind.JsonMappingException: no content to map due to end-of-input

Upvotes: 0

Views: 3985

Answers (2)

Susanna Michael
Susanna Michael

Reputation: 161

How I solved this issue:

I autowired the DefaultCamelContext bean in my routeBuilder class and set the stream caching to true. This will set stream caching to true globally.

@Autowired
DefaultCamelContext camelContext;

Then set stream caching to true:

 camelContext.setStreamCaching(true);

Alternatively you can also set stream caching true for a single router as follows:

from("jbi:service:http://myService.org")
    .streamCaching(true)
    .to("jbi:service:http://myOtherService.org");

Upvotes: 1

Claus Ibsen
Claus Ibsen

Reputation: 55525

Maybe its due to streaming - can only read once problem, and since you logged it, its empty. See this FAQ: http://camel.apache.org/why-is-my-message-body-empty.html

Upvotes: 3

Related Questions