Exchange.getIn().getBody() returns empty string in camel on second call

前端 未结 1 1282
说谎
说谎 2020-12-18 04:48

I have 2 identical calls:

String msg1 = exchange.getIn().getBody(String.class);
String msg2 = exchange.getIn().getBody(String.class);

In ms

1条回答
  •  长情又很酷
    2020-12-18 05:12

    From http://camel.apache.org/jetty.html

    Jetty is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream once.

    Just convert the input in a String before use it twice or more times

    
        
        
        
    
    

    0 讨论(0)
提交回复
热议问题