Hi everyone!

I'm having this problem with synchronous routes and passing objects back to
the caller.

The route is defined as:

public static final String BEAN = "bean:";
public static final String METHOD = "?method=";

from("activemq:queue:start")
    .inOut()
    .to(BEAN + "handler" + METHOD + "printType")                // prints the 
object type
    .to(BEAN + "handler" + METHOD + "returnsListOfB")           // returns a 
List
with 3 elements of type B

    .split(body())                                              // splits the 
list into individual type B elements
    .aggregationStrategy(new UseLatestAggregationStrategy())

    .to(BEAN + "handler" + METHOD + "printType")                // prints the 
object type
    .to("activemq:queue:continue");
        
        
from("activemq:queue:continue")
    .inOut()
    .to(BEAN + "handler" + METHOD + "printType")                // prints the 
object type
    .to(BEAN + "handler" + METHOD + "doesNothing");             // makes 
absolutely no
changes to the object passed in


The object being put on to the "start" queue is of type A. All of the
methods are very basic and do exactly what their names say. What I expect is
an object of type B to be returned upon making a call such as this one:


    A a = new A();
    Object o = camelTemplate.requestBody("activemq:queue:start", a);


Instead, I get the following exception after the object has reached the end
of the route and nothing was passed back:


org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 20000 millis. Exchange[Message: com.ee.jbube.temporary.A@1c493dca]
        at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:109)
        at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:59)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:34)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:26)
        at
org.apache.camel.util.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:202)
        at 
org.apache.camel.util.DefaultTimeoutMap.run(DefaultTimeoutMap.java:154)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)


Interesting enough is the fact that when I replace all of the
"activemq:queue" statements with "seda", everything works just perfectly!
The version of Camel I'm using is 2.5.0 and ActiveMQ is 5.4.2.


Does anyone know what I'm doing wrong here? Thank you!

Frankie



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-getting-response-in-synchronous-route-tp4330451p4330451.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to