You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ak-dak <ku...@dakosy.de> on 2013/10/21 14:27:11 UTC

ActiveMq-InOut: save exchange body

Hi all,

I have two camel applications which are communicating over ActiveMq which
each other. "Application A" is using classes which are not in class path of
"Application B". Now I want to call in my camel route of "Application A" a
service method of "Application B" without loosing the exchange body. 
Thats my example route:

<route>
  <from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
  <bean ref="myBean" method="saveEntityAndPut2Exchange" />
  <to uri="activemq:queue:getReferenceFromApplicationB" pattern="InOut" />
  <bean ref="myBean" method="workWithentityAndReference" />
</route>

First ("Application A"), I save an entity in method
"saveEntityAndPut2Exchange" and put it into the camel exchange.
Second, I want to get a reference value from "Application B" by using
ActiveMQ.
Third, I want to use the entity and the reference.

The problem is, that "Application B" has not the class of the entity within
the class path. Therefore I can't send the entity to "Application B". How
can I save the exchange body with the entity till the end of the route?

Best regards



--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ActiveMq-InOut: save exchange body

Posted by ak-dak <ku...@dakosy.de>.
Hi Christian,

I've tried it, but I got the same time out exception. I'am using Camel
2.10.0 and Spring 3.0.5.
Do you have any further suggestions?

Best regards



--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742160.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ActiveMq-InOut: save exchange body

Posted by Christian Müller <ch...@gmail.com>.
Could you try:

<camelContext xmlns="http://camel.apache.org/schema/spring">
  <route id="routeOne">
    <from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
    <to uri="activemq:queue:routeTwo" />
  </route>

  <route id="routeTwo">
    <from uri="activemq:queue:routeTwo" />
    <bean ref="myBean" method="print" />
    <setExchangePattern pattern="InOut"/>
    <enrich uri="activemq:queue:enrichTest" strategyRef="myEnrichStrategy"/>
    <bean ref="myBean" method="printAfterEnrich" />
  </route>

  <route id="routeThree">
    <from uri="activemq:queue:enrichTest" />
    <bean ref="myBean" method="enrich" />
  </route>
</camelContext>

By default, the timer component use the InOnly message exchange pattern
(MEP). This means the message which is send to "activemq:queue:enrichTest"
will not produce a response the enricher is waiting for. Have a look at [1].

[1] http://camel.apache.org/request-reply.html

Best

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Thu, Oct 24, 2013 at 8:29 AM, ak-dak <ku...@dakosy.de> wrote:

> Hi,
>
> I have a simple example which works as expected:
>
> -----------------------------------------------------------------------------------
> *Camel-Routes:*
> <beans ...>
>        <bean id="myBean" class="de.mycompany.activemq.MyBean" />
>         <bean id="myEnrichStrategy"
> class="de.mycompany.activemq.MyEnrichStrategy"/>
>
>         <camelContext xmlns="http://camel.apache.org/schema/spring">
>
> <route id="routeOne">
>                         <from
> uri="timer://myTimer?fixedRate=true&amp;period=5s" />
>                         <bean ref="myBean" method="print" />
>                         <enrich uri="activemq:queue:enrichTest"
> strategyRef="myEnrichStrategy"/>
>                         <bean ref="myBean" method="printAfterEnrich" />
>                 </route>
>
>                 <route id="routeTwo">
>                         <from uri="activemq:queue:enrichTest" />
>                         <bean ref="myBean" method="enrich" />
>                 </route>
>
>         </camelContext>
> </beans>
>
> *Bean-Class:*
> public class MyBean {
>
>         public void print(Exchange exchange) {
>                 System.out.println("start");
>                 exchange.getOut().setBody("beforeEnrich: ");
>         }
>
>         public void enrich(Exchange exchange) {
>                 System.out.println("enrich");
>
>                 exchange.getOut().setBody("enrich-body");
>         }
>
>         public void printAfterEnrich(Exchange exchange) {
>                 System.out.println("printAfterEnrich-body: " +
> exchange.getIn().getBody());
>         }
> }
>
> *Enricher-Class:*
> public class MyEnrichStrategy implements AggregationStrategy {
>
>         @Override
>         public Exchange aggregate(Exchange original, Exchange resource) {
>                 String originalBody =
> original.getIn().getBody(String.class);
>                 String resourceResponse =
> resource.getIn().getBody(String.class);
>
>                 originalBody += resourceResponse;
>                 original.getIn().setBody(originalBody);
>
>                 return original;
>         }
> }
>
>
> -----------------------------------------------------------------------------------
>
> But if I separate the routes with activeMq it doesn't works anymore.
> Thats are not working camel routes:
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>
>                 <route id="routeOne">
>                         <from
> uri="timer://myTimer?fixedRate=true&amp;period=5s" />
>                         <to uri="activemq:queue:routeTwo" />
>                 </route>
>
>                 <route id="routeTwo">
>                         <from uri="activemq:queue:routeTwo" />
>                         <bean ref="myBean" method="print" />
>                         <enrich uri="activemq:queue:enrichTest"
> strategyRef="myEnrichStrategy"/>
>                         <bean ref="myBean" method="printAfterEnrich" />
>                 </route>
>
>                 <route id="routeThree">
>                         <from uri="activemq:queue:enrichTest" />
>                         <bean ref="myBean" method="enrich" />
>                 </route>
>
>         </camelContext>
>
> I got a time out exception:
>
> 08:27:08,236 WARN
> [org.apache.camel.component.jms.reply.TemporaryQueueReplyManager] Timeout
> occurred after 20000 millis waiting for reply message with correlationID
> [ID-P00563-49858-1382595520631-4-17]. Setting ExchangeTimedOutException on
> (MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
> ID-P00563-49858-1382595520631-4-22) and continue routing.
> 08:27:08,236 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed
> delivery for (MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
> ID-P00563-49858-1382595520631-4-15). Exhausted after delivery attempt: 1
> caught: org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received within: 20000 millis due reply message with correlationID:
> ID-P00563-49858-1382595520631-4-17 not received.
> Exchange[JmsMessage@0x1997f541]:
> org.apache.camel.ExchangeTimedOutException:
> The OUT message was not received within: 20000 millis due reply message
> with
> correlationID: ID-P00563-49858-1382595520631-4-17 not received.
> Exchange[JmsMessage@0x1997f541]
>         at
>
> org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)
> [camel-core-2.10.0.jar:2.10.0]
>         at
> org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)
> [camel-core-2.10.0.jar:2.10.0]
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [rt.jar:1.7.0_13]
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
> [rt.jar:1.7.0_13]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [rt.jar:1.7.0_13]
>         at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
>
> 08:27:08,236 WARN  [org.apache.camel.component.jms.EndpointMessageListener]
> Execution of JMS message listener failed. Caused by:
> [org.apache.camel.RuntimeCamelException -
> org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received
> within: 20000 millis due reply message with correlationID:
> ID-P00563-49858-1382595520631-4-17 not received.
> Exchange[JmsMessage@0x1997f541]]: org.apache.camel.RuntimeCamelException:
> org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received
> within: 20000 millis due reply message with correlationID:
> ID-P00563-49858-1382595520631-4-17 not received.
> Exchange[JmsMessage@0x1997f541]
>         at
>
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1280)
> [camel-core-2.10.0.jar:2.10.0]
>         at
>
> org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:187)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:108)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> [spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [rt.jar:1.7.0_13]
>         at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
> Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was
> not received within: 20000 millis due reply message with correlationID:
> ID-P00563-49858-1382595520631-4-17 not received.
> Exchange[JmsMessage@0x1997f541]
>         at
>
> org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
> [camel-jms-2.10.1.jar:2.10.1]
>         at
>
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)
> [camel-core-2.10.0.jar:2.10.0]
>         at
> org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)
> [camel-core-2.10.0.jar:2.10.0]
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [rt.jar:1.7.0_13]
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
> [rt.jar:1.7.0_13]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
> [rt.jar:1.7.0_13]
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> [rt.jar:1.7.0_13]
>         ... 3 more
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742113.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: ActiveMq-InOut: save exchange body

Posted by contactreji <co...@gmail.com>.
Hi

I had similar error while working with a webservice. The error was 
Timeout occurred after 20000 millis waiting for reply message

My code was like

 <route id="CopperInConcetrate_route_1">
        <from
uri="cxf:bean:mestobw_CopperinConcentrate?dataFormat=PAYLOAD"/>
        <convertBodyTo type="java.lang.String"/>
        <to uri="{{inboudQueueName}}"/>
    </route>
And it gave the above error


I change it to 

 <route id="CopperInConcetrate_route_1">
        <from
uri="cxf:bean:mestobw_CopperinConcentrate?dataFormat=PAYLOAD"/>
        *<setExchangePattern pattern="InOnly"/>*
        <convertBodyTo type="java.lang.String"/>
        <to uri="{{inboudQueueName}}"/>
    </route>

which indeed solved my problem!


This usually occurs when the MEP is INOUT. If you keep INOUT, make sure you
have the camel exchange in the last component of the route some valid value
which can be returned back. (Am talking from web service perspective)

It can be resolved by changing the MEP from INOUT to INONLY.

Cheers
Reji



--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742116.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ActiveMq-InOut: save exchange body

Posted by ak-dak <ku...@dakosy.de>.
Hi,

I have a simple example which works as expected:
-----------------------------------------------------------------------------------
*Camel-Routes:*
<beans ...>
       <bean id="myBean" class="de.mycompany.activemq.MyBean" />
	<bean id="myEnrichStrategy"
class="de.mycompany.activemq.MyEnrichStrategy"/>

	<camelContext xmlns="http://camel.apache.org/schema/spring">

<route id="routeOne">
			<from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
			<bean ref="myBean" method="print" />
			<enrich uri="activemq:queue:enrichTest" strategyRef="myEnrichStrategy"/>
			<bean ref="myBean" method="printAfterEnrich" />
		</route>
		
		<route id="routeTwo">
			<from uri="activemq:queue:enrichTest" />
			<bean ref="myBean" method="enrich" />
		</route>

	</camelContext>
</beans>

*Bean-Class:*
public class MyBean {
	
	public void print(Exchange exchange) {
		System.out.println("start");
		exchange.getOut().setBody("beforeEnrich: ");
	}
	
	public void enrich(Exchange exchange) {
		System.out.println("enrich");
		
		exchange.getOut().setBody("enrich-body");
	}
	
	public void printAfterEnrich(Exchange exchange) {
		System.out.println("printAfterEnrich-body: " +
exchange.getIn().getBody());
	}	
}

*Enricher-Class:*
public class MyEnrichStrategy implements AggregationStrategy {
	
	@Override
	public Exchange aggregate(Exchange original, Exchange resource) {
		String originalBody = original.getIn().getBody(String.class);
		String resourceResponse = resource.getIn().getBody(String.class);
		
		originalBody += resourceResponse;
		original.getIn().setBody(originalBody);
		
		return original;
	}	
}

-----------------------------------------------------------------------------------

But if I separate the routes with activeMq it doesn't works anymore.
Thats are not working camel routes:

<camelContext xmlns="http://camel.apache.org/schema/spring">

		<route id="routeOne">
			<from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
			<to uri="activemq:queue:routeTwo" />
		</route>
		
		<route id="routeTwo">
			<from uri="activemq:queue:routeTwo" />
			<bean ref="myBean" method="print" />
			<enrich uri="activemq:queue:enrichTest" strategyRef="myEnrichStrategy"/>
			<bean ref="myBean" method="printAfterEnrich" />
		</route>
		
		<route id="routeThree">
			<from uri="activemq:queue:enrichTest" />
			<bean ref="myBean" method="enrich" />
		</route>

	</camelContext>

I got a time out exception:

08:27:08,236 WARN 
[org.apache.camel.component.jms.reply.TemporaryQueueReplyManager] Timeout
occurred after 20000 millis waiting for reply message with correlationID
[ID-P00563-49858-1382595520631-4-17]. Setting ExchangeTimedOutException on
(MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
ID-P00563-49858-1382595520631-4-22) and continue routing.
08:27:08,236 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed
delivery for (MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
ID-P00563-49858-1382595520631-4-15). Exhausted after delivery attempt: 1
caught: org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within: 20000 millis due reply message with correlationID:
ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]: org.apache.camel.ExchangeTimedOutException:
The OUT message was not received within: 20000 millis due reply message with
correlationID: ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]
	at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)
[camel-core-2.10.0.jar:2.10.0]
	at
org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)
[camel-core-2.10.0.jar:2.10.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
[rt.jar:1.7.0_13]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_13]
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

08:27:08,236 WARN  [org.apache.camel.component.jms.EndpointMessageListener]
Execution of JMS message listener failed. Caused by:
[org.apache.camel.RuntimeCamelException -
org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 20000 millis due reply message with correlationID:
ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]]: org.apache.camel.RuntimeCamelException:
org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 20000 millis due reply message with correlationID:
ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1280)
[camel-core-2.10.0.jar:2.10.0]
	at
org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:187)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:108)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
[spring-jms-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_13]
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was
not received within: 20000 millis due reply message with correlationID:
ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]
	at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
[camel-jms-2.10.1.jar:2.10.1]
	at
org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)
[camel-core-2.10.0.jar:2.10.0]
	at
org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)
[camel-core-2.10.0.jar:2.10.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
[rt.jar:1.7.0_13]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[rt.jar:1.7.0_13]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[rt.jar:1.7.0_13]
	... 3 more




--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742113.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ActiveMq-InOut: save exchange body

Posted by Christian Müller <ch...@gmail.com>.
What kind of issue do you face?

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Oct 22, 2013 at 12:43 PM, ak-dak <ku...@dakosy.de> wrote:

> Hi,
>
> the enricher is a good component but it seems not to work in asynchronous
> routes. My routes are connected with each other over ActiveMq and exchange
> pattern "InOnly".
>
> Best regards
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742025.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: ActiveMq-InOut: save exchange body

Posted by ak-dak <ku...@dakosy.de>.
Hi,

the enricher is a good component but it seems not to work in asynchronous
routes. My routes are connected with each other over ActiveMq and exchange
pattern "InOnly".

Best regards




--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742025.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ActiveMq-InOut: save exchange body

Posted by Christian Müller <ch...@gmail.com>.
Check [1]. Something like:

from("...")
.enrich("activemq:...", aggregationStrategy)
.to("...");

[1] http://camel.apache.org/content-enricher.html

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Oct 21, 2013 at 2:27 PM, ak-dak <ku...@dakosy.de> wrote:

> Hi all,
>
> I have two camel applications which are communicating over ActiveMq which
> each other. "Application A" is using classes which are not in class path of
> "Application B". Now I want to call in my camel route of "Application A" a
> service method of "Application B" without loosing the exchange body.
> Thats my example route:
>
> <route>
>   <from uri="timer://myTimer?fixedRate=true&amp;period=5s" />
>   <bean ref="myBean" method="saveEntityAndPut2Exchange" />
>   <to uri="activemq:queue:getReferenceFromApplicationB" pattern="InOut" />
>   <bean ref="myBean" method="workWithentityAndReference" />
> </route>
>
> First ("Application A"), I save an entity in method
> "saveEntityAndPut2Exchange" and put it into the camel exchange.
> Second, I want to get a reference value from "Application B" by using
> ActiveMQ.
> Third, I want to use the entity and the reference.
>
> The problem is, that "Application B" has not the class of the entity within
> the class path. Therefore I can't send the entity to "Application B". How
> can I save the exchange body with the entity till the end of the route?
>
> Best regards
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>