Christian:

Vielen Dank fuer Deine Antwort! Aber (jetzt auf Englisch) please see my 
comments, inline:

> To: users@camel.apache.org
> Date: Tue, 22 Mar 2011 09:12:16 +0100
> Subject: AW: InOut over JMS always leads to Timout (ExchangeTimedOutException)
> 
> Hi,
> 
> I have no yet really run your example but I have successfully run similar 
> examples so camel should be able to do what you want to achieve here.
> 
> Some ideas how your code can be made simpler. For the processor you should 
> use the bean features of camel. Simply create your processor like this:
> 
> class MyProcessor {
>   public String doStuff(String inMsg) {
>      return "hello " + inMsg;
>   }
> }
> 
> This does the same as your code.

In the real world application - I tried to simplify it so as to 
replicate/demonstrate that a problem exists - I implemented a Processor 
because the message has several values set in Headers. I am aware of 
Camel's excellent automatic conversion of the payload (as in your 
example) but I am not aware of how to also declare and access any
 Header properties without access to the Exchange.



> 
> The next thing is you do not need to use inOut jms and activemq components 
> use InOut by default. To call the bean simply use:
> 
> <to uri="myBean"/>
> 
> and define the bean in spring:
> 
> <bean id="myBean" class="MyProcessor"/>

The client application runs on a separate machine from the server. 
Additionally, I do not want the client applications to have to "know" the bean 
that processes the requests; but rather only the endpoint name. I had hoped to 
be able to make synchronous calls over JMS because it somehow feels more 
loosely coupled (although, it could be argued that knowing the endpoint name 
still makes it point-to-point).

Forgive me if I misunderstood your point. 

Thanks again,

Mike L. (aka patzerbud)

> 
> This should work nicely.
> 
> Christian
> 
> Von: Mike L. [mailto:patzer...@hotmail.com]
> Gesendet: Montag, 21. März 2011 20:46
> An: users@camel.apache.org
> Betreff: InOut over JMS always leads to Timout (ExchangeTimedOutException)
> 
> All:
> 
> I have been trying to take advantage of the InOut pattern over JMS. I am 
> using Camel 2.4.0 and ActiveMQ 5.3.1
> 
> I have created a simple example that can be run to replicate the problem I am 
> experiencing. Attached please find the source code plus ant build file. 
> Within the libs folder is a file listing all required jars (sorry - I wasn't 
> sure about uploading a 30M file to this list!).
> 
> Once you have the necessary jars in place under libs/compile then in two 
> terminal windows:
> 
> ant clean run-consumer
> 
> ant run-publisher
> 
> The consumer implements the InOut processor and the publisher invokes it over 
> JMS.
> 
> Within the second terminal window you will soon see
>   [java] Caused by: org.apache.camel.ExchangeTimedOutException: The OUT 
> message was not received within: 20000 millis. Exchange[Message: John]
>      [java]     at 
> org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:265)
>      [java]     at 
> org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
> 
> Originally I had specified 5 consumers in the 
> metadata/test-env/res/applicationContext-consumer.xml file. However, I can 
> set the number of consumers down to one and the same problem occurs. BTW, we 
> use a clustered environment - so I would like to specify multiple consumers 
> and use multiple computers.
> 
> Any insight into this would be greatly appreciated!!
> 
> TIA,
> 
> Mike L. (aka patzerbud)
                                          

Reply via email to