Hi Willem and Gert,
You were right. I needed to use convertBodyTo(String.class) to avoid closing
the streams. I added this instruction after and before the transformation
route:
from("jetty:http://localhost:9080/research_msp/VirtualService")
.convertBodyTo(java.lang.String.class)
.process(new SOAPRequestTransformProcessor())
.convertBodyTo(java.lang.String.class)
.to("log:IN")
.choice()
.when(isDocumentRequest)
.to("log:REQUEST_1")
.to("jbi:service:http://path.to.service/ServiceName1//ServiceName2WSDL")
.when(isVersionRequest)
.to("log:REQUEST_2")
.to("jbi:service:http://path.to.service/ServiceName2//ServiceName2WSDL")
.when(isLiferayRequest)
.to("log:REQUEST_3")
.to("jbi:service:http://path.to.service/ServiceName3//ServiceName2WSDL")
.otherwise()
.to("log:NOT_SUPPORTED")
.throwFault(new IllegalArgumentException("The requested
operation is not supported."))
.end();
* Before because this way I don't need to cast the body to an InputStream
and then transform it to a String in my transformation POJO.
* After because multiple routes and predicates read the message after its
transformed, so if I don't transform it here the Stream will get closed. Now
I can put back my log routes ;)
Right now I can send the JBI messages to the correct CXF BCs. I need to
figure out how to get response back from them synchronously... but that's a
topic for another Thread.
Thanks to everyone for your help!
Regards,
Angel
willem.jiang wrote:
>
> Sorry , I don't know which version of camel that Servicemix 3.2.3 is
> using.
>
> As Gert said , the issue may relates to the Stream caching, from the log
> I can see the InputStream is turned into InputStreamCache. But I'm not
> sure if your servicemix-camel component hit the old version of camel's
> bug of stream caching.
>
> INFO - REQUEST_B -
> Exchange[BodyType:org.apache.camel.converter.stream.StreamCacheConverter.InputStreamCache,
> Body:<jbi:message xmlns="http://java.sun.com/xml/ns/jbi"
> xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"><jbi:part><sons:displayInformation
> xmlns:sons="http://path.to.service/InformationService/"><approver>000000001</approver></sons:displayInformation></jbi:part></jbi:message>
> ]
>
> Can you comment out the log route rule and try again ?
> If I remember right there was an issue of camel logger which doesn't
> reset the cached stream long time ago.
>
> Willem
>
>
--
View this message in context:
http://www.nabble.com/Web-Services-Virtualization-using-ServiceMix-tp25514386p25618712.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.