I just did a quick test camel-jms component and confirmed camel-jms component
can send the message headers across the queue.
It looks like you need to let you ProducerTemplate wait for the response a bit
longer by specifying requestTimeout.
The default value is 20000 which means 20 second, please make sure the WS
service can send response back less then 20 second otherwise you need to change
the requestTimeout like this.
> Status msg =
> producerTemplate.requestBodyAndHeaders("activemq:wsb?requestTimeout=60000",
> params, header, Status.class);
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
(English)
http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Wednesday, October 17, 2012 at 10:40 PM, jkob wrote:
> Hello,
>
> I want to connect some AMQ-queues to web services and got a strange problem.
> I'm able to connect directly to the CXF service, but when I use AMQ in front
> in conjunction with an "operationName" header Camel doesn't deliver the
> response and creates an ExchangeTimedOutException.
>
> OK, I try to clarify. WebServiceA has just one method. WebServiceB has 6
> methods.
>
> This works:
> from("activemq:wsa").to("cxf:bean:webServiceA");
>
> Status msg = producerTemplate.requestBody("activemq:wsa", params,
> Status.class);
>
>
> This does NOT work (results in a timeout):
> from("activemq:wsb").to("cxf:bean:webServiceB");
>
> Map<String, Object> header = new HashMap<String, Object>();
> header.put(CxfConstants.OPERATION_NAME, "doSomething");
> header.put(CxfConstants.OPERATION_NAMESPACE, "http://.../");
>
> Status msg = producerTemplate.requestBodyAndHeaders("activemq:wsb", params,
> header, Status.class);
>
> What strikes me a lot, my TCP/IP monitor shows that a correct request is
> created, processed and returned.
>
> This works:
> Status msg = producerTemplate.requestBodyAndHeaders("cxf:bean:webServiceB",
> params, header, WebServiceB.class);
>
> This is the config for the endpoints:
> <cxf:cxfEndpoint id="wsa" address="http://localhost:8282/cxf/wsa"
> serviceClass="WebServiceA" />
> <cxf:cxfEndpoint id="wsb" address="http://localhost:8282/cxf/wsb"
> serviceClass="WebServiceB" />
>
> AMQ and CXF are run by FuseESB.
>
> I have the feeling, that I somehow should do something with the headers, but
> I have no idea what could be the problem. What I can't understand is what my
> TCP/IP monitors tells me and what sounds to me like a bug. Although I think
> it should be a quite normal scenario to bridge AMQ and CXF.
>
> Many regards
> Jakob
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Strange-problem-when-bridging-amq-to-cxf-tp5721182.html
> Sent from the Camel - Users mailing list archive at Nabble.com
> (http://Nabble.com).