[ 
https://issues.apache.org/activemq/browse/CAMEL-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-1770.
--------------------------------

       Resolution: Cannot Reproduce
    Fix Version/s: 2.0.0

trunk: 789610.

Working fine here.

I have added explicit unit test based on your route. 

> InOut exchange pattern is not detected by routes
> ------------------------------------------------
>
>                 Key: CAMEL-1770
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1770
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.0-M2
>         Environment: sunJDK6u14 sunJDK 6u13
>            Reporter: Eric Bouer
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> The following test code should send a "hello world"  request and receive a 
> "bye world" response.
> The JMSReplyTo field is set. but camel won't send a reply.
> If I explicitly set the exchange pattern in the route all goes fine.
> This code uses template.send() , I also got the same error with 
> template.asycRequestBody()
> ============= Code  snippet ===============
>  context.addComponent("test-jms", 
> ActiveMQComponent.jmsComponent(connectionFactory));
>         context.addRoutes(new RouteBuilder() {
>             public void configure() {
>               from("test-jms:queue:test")
>                              //.setExchangePattern(ExchangePattern.InOut) <-- 
> Setting this explicitly solves the issue. camel should detect that 
> automatically.
>                     .process(new Processor() {
>                     public void process(Exchange exchange) throws Exception {
>                         exchange.getIn().setBody("Bye world");
>                         
> System.out.println(exchange.getProperty(JmsConstants.JMS_REPLY_DESTINATION).toString());
>                     }
>                 });
>             }});
>         ProducerTemplate template = context.createProducerTemplate();
>         context.start();
>          Exchange out = template.send("test-jms:queue:test", 
> ExchangePattern.InOut, new Processor() {
>             public void process(Exchange exchange) throws Exception {
>                 exchange.getIn().setBody("Hello World");
>             }
>         });
> ================Logs: 
> =============================================================
> 11:32:59,605 DEBUG DefaultCamelContext:497 - Adding routes from: Routes: 
> [Route[[From[test-jms:queue:test]] -> 
> [process[com.mycompany.camelexample.app$...@4b14b82b]]]] routes: []
> 11:32:59,611  INFO DefaultCamelContext:875 - Apache Camel 2.0-M2 
> (CamelContext:camel-1) is starting
> 11:32:59,612 DEBUG DefaultProducerServicePool:93 - Starting service pool: 
> org.apache.camel.impl.defaultproducerservicep...@6293df2c
> 11:32:59,613 DEBUG DefaultCamelContext:882 - StreamCaching is enabled
> 11:32:59,720 DEBUG DefaultInstrumentationAgent:229 - Starting JMX agent on 
> server: com.sun.jmx.mbeanserver.jmxmbeanser...@4b8a6e6e
> 11:32:59,921 DEBUG DefaultInstrumentationAgent:293 - Registered MBean with 
> objectname: org.apache.camel:context=niso/camel-1,name=context
> 11:33:00,000 DEBUG DefaultComponent:77 - Creating endpoint 
> uri=[test-jms:queue:test], path=[queue:test], parameters=[{}]
> 11:33:00,009 DEBUG DefaultCamelContext:379 - test-jms:queue:test converted to 
> endpoint: Endpoint[test-jms:queue:test] by component: 
> org.apache.camel.component.jms.jmscompon...@410d3f0d
> 11:33:00,044 DEBUG DefaultInstrumentationAgent:293 - Registered MBean with 
> objectname: 
> org.apache.camel:context=niso/camel-1,type=endpoints,name="test-jms:queue:test\?id=0xa6c6baa1"
> 11:33:00,119 DEBUG DefaultInstrumentationAgent:293 - Registered MBean with 
> objectname: 
> org.apache.camel:context=niso/camel-1,type=processors,nodeid=process1,name="process[com.mycompany.camelexample.app$...@4b14b82b]"
> 11:33:00,180 DEBUG DefaultInstrumentationAgent:293 - Registered MBean with 
> objectname: org.apache.camel:context=niso/camel-1,type=routes,name="route1"
> 11:33:00,203 DEBUG DefaultInstrumentationAgent:293 - Registered MBean with 
> objectname: 
> org.apache.camel:context=niso/camel-1,type=consumers,name=JmsConsumer(0x6ec5122f)
> 11:33:00,522 DEBUG WireFormatNegotiator:77 - Sending: WireFormatInfo { 
> version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,525 DEBUG DefaultMessageListenerContainer:347 - Established shared 
> JMS Connection
> 11:33:00,552 DEBUG WireFormatNegotiator:108 - Received WireFormat: 
> WireFormatInfo { version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,553 DEBUG WireFormatNegotiator:115 - tcp://amq1/192.168.5.28:61616 
> before negotiation: OpenWireFormat{version=3, cacheEnabled=false, 
> stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false}
> 11:33:00,554 DEBUG WireFormatNegotiator:130 - tcp://amq1/192.168.5.28:61616 
> after negotiation: OpenWireFormat{version=3, cacheEnabled=true, 
> stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false}
> 11:33:00,712 DEBUG DefaultProducerServicePool:97 - Stopping service pool: 
> org.apache.camel.impl.defaultproducerservicep...@6293df2c
> 11:33:00,737  INFO DefaultCamelContext:868 - Apache Camel 2.0-M2 
> (CamelContext:camel-1) started
> 11:33:00,743 DEBUG ProducerCache:196 - Adding to producer cache with key: 
> Endpoint[test-jms:queue:test] for producer: Producer[test-jms:queue:test]
> 11:33:00,847 DEBUG ProducerCache:163 - >>>> Endpoint[test-jms:queue:test] 
> Exchange[JmsMessage: Hello World]
> 11:33:00,857 DEBUG WireFormatNegotiator:77 - Sending: WireFormatInfo { 
> version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,859 DEBUG SimpleMessageListenerContainer:347 - Established shared 
> JMS Connection
> 11:33:00,877 DEBUG WireFormatNegotiator:108 - Received WireFormat: 
> WireFormatInfo { version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,878 DEBUG WireFormatNegotiator:115 - tcp://amq1/192.168.5.28:61616 
> before negotiation: OpenWireFormat{version=3, cacheEnabled=false, 
> stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false}
> 11:33:00,878 DEBUG WireFormatNegotiator:130 - tcp://amq1/192.168.5.28:61616 
> after negotiation: OpenWireFormat{version=3, cacheEnabled=true, 
> stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false}
> 11:33:00,948 DEBUG JmsProducer:202 - Using JMS API v1.1
> 11:33:00,954 DEBUG WireFormatNegotiator:77 - Sending: WireFormatInfo { 
> version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,958 DEBUG WireFormatNegotiator:108 - Received WireFormat: 
> WireFormatInfo { version=3, properties={CacheSize=1024, CacheEnabled=true, 
> SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, 
> TcpNoDelayEnabled=true, MaxInactivityDuration=30000, 
> TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
> 11:33:00,958 DEBUG WireFormatNegotiator:115 - tcp://amq1/192.168.5.28:61616 
> before negotiation: OpenWireFormat{version=3, cacheEnabled=false, 
> stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false}
> 11:33:00,958 DEBUG WireFormatNegotiator:130 - tcp://amq1/192.168.5.28:61616 
> after negotiation: OpenWireFormat{version=3, cacheEnabled=true, 
> stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false}
> 11:33:00,987 DEBUG JmsConfiguration$CamelJmsTemplate:469 - Executing callback 
> on JMS Session: ActiveMQSession 
> {id=ID:niso-55060-1246264380379-0:2:1,started=false}
> 11:33:00,992 DEBUG JmsBinding:370 - Using JmsMessageType: Text
> 11:33:01,023 DEBUG JmsProducer:188 - Endpoint[test-jms:queue:test] sending 
> JMS message: ActiveMQTextMessage {commandId = 0, responseRequired = false, 
> messageId = null, originalDestination = null, originalTransactionId = null, 
> producerId = null, destination = null, transactionId = null, expiration = 0, 
> timestamp = 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, 
> correlationId = ID-niso-53590-1246264380744-2-0, replyTo = 
> temp-queue://ID:niso-55060-1246264380379-0:1:1, persistent = false, type = 
> null, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = 
> null, compressed = false, userID = null, content = null, marshalledProperties 
> = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = 
> null, readOnlyProperties = false, readOnlyBody = false, droppable = false, 
> text = Hello World}
> 11:33:01,024 DEBUG JmsConfiguration$CamelJmsTemplate:202 - Sending created 
> message: ActiveMQTextMessage {commandId = 0, responseRequired = false, 
> messageId = null, originalDestination = null, originalTransactionId = null, 
> producerId = null, destination = null, transactionId = null, expiration = 0, 
> timestamp = 0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, 
> correlationId = ID-niso-53590-1246264380744-2-0, replyTo = 
> temp-queue://ID:niso-55060-1246264380379-0:1:1, persistent = false, type = 
> null, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = 
> null, compressed = false, userID = null, content = null, marshalledProperties 
> = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = 
> null, readOnlyProperties = false, readOnlyBody = false, droppable = false, 
> text = Hello World}
> 11:33:01,026 DEBUG ActiveMQSession:1640 - ID:niso-55060-1246264380379-0:2:1 
> sending message: ActiveMQTextMessage {commandId = 0, responseRequired = 
> false, messageId = ID:niso-55060-1246264380379-0:2:1:1:1, originalDestination 
> = null, originalTransactionId = null, producerId = 
> ID:niso-55060-1246264380379-0:2:1:1, destination = queue://test, 
> transactionId = null, expiration = 1246264401026, timestamp = 1246264381026, 
> arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = 
> ID-niso-53590-1246264380744-2-0, replyTo = 
> temp-queue://ID:niso-55060-1246264380379-0:1:1, persistent = true, type = 
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = 
> null, compressed = false, userID = null, content = null, marshalledProperties 
> = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = 
> null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text 
> = Hello World}
> 11:33:01,057 DEBUG ActiveMQMessageConsumer:432 - 
> ID:niso-55060-1246264380379-0:0:1:1 received message: MessageDispatch 
> {commandId = 0, responseRequired = false, consumerId = 
> ID:niso-55060-1246264380379-0:0:1:1, destination = queue://test, message = 
> ActiveMQTextMessage {commandId = 5, responseRequired = true, messageId = 
> ID:niso-55060-1246264380379-0:2:1:1:1, originalDestination = null, 
> originalTransactionId = null, producerId = 
> ID:niso-55060-1246264380379-0:2:1:1, destination = queue://test, 
> transactionId = null, expiration = 1246264401026, timestamp = 1246264381026, 
> arrival = 0, brokerInTime = 1246264325691, brokerOutTime = 1246264325719, 
> correlationId = ID-niso-53590-1246264380744-2-0, replyTo = 
> temp-queue://ID:niso-55060-1246264380379-0:1:1, persistent = true, type = 
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = 
> null, compressed = false, userID = null, content = null, marshalledProperties 
> = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = 
> null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text 
> = Hello World}, redeliveryCounter = 0}
> 11:33:01,057 DEBUG DefaultMessageListenerContainer:311 - Received message of 
> type [class org.apache.activemq.command.ActiveMQTextMessage] from consumer 
> [ActiveMQMessageConsumer { value=ID:niso-55060-1246264380379-0:0:1:1, 
> started=true }] of session [ActiveMQSession 
> {id=ID:niso-55060-1246264380379-0:0:1,started=true}]
> 11:33:01,060 DEBUG EndpointMessageListener:66 - Endpoint[test-jms:queue:test] 
> consumer receiving JMS message: ActiveMQTextMessage {commandId = 5, 
> responseRequired = true, messageId = ID:niso-55060-1246264380379-0:2:1:1:1, 
> originalDestination = null, originalTransactionId = null, producerId = 
> ID:niso-55060-1246264380379-0:2:1:1, destination = queue://test, 
> transactionId = null, expiration = 1246264401026, timestamp = 1246264381026, 
> arrival = 0, brokerInTime = 1246264325691, brokerOutTime = 1246264325719, 
> correlationId = ID-niso-53590-1246264380744-2-0, replyTo = 
> temp-queue://ID:niso-55060-1246264380379-0:1:1, persistent = true, type = 
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = 
> null, compressed = false, userID = null, content = null, marshalledProperties 
> = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = 
> null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text 
> = Hello World}
> 11:33:01,066 DEBUG DefaultPackageScanClassResolver:80 - Searching for 
> annotations of org.apache.camel.Converter in packages: 
> [org.apache.camel.component.file, org.apache.camel.converter, 
> org.apache.camel.component.activemq, org.apache.activemq.camel.converter, 
> org.apache.camel.spring.converter]
> 11:33:01,067 DEBUG DefaultPackageScanClassResolver:243 - Loading from jar: 
> /home/ori7/.m2/repository/org/apache/camel/camel-core/2.0-M2/camel-core-2.0-M2.jar
> 11:33:01,077 DEBUG TcpTransport:458 - Stopping transport 
> tcp://amq1/192.168.5.28:61616
> 11:33:01,352 DEBUG DefaultPackageScanClassResolver:243 - Loading from jar: 
> /home/ori7/.m2/repository/org/apache/camel/camel-core/2.0-M2/camel-core-2.0-M2.jar
> 11:33:01,527 DEBUG DefaultPackageScanClassResolver:243 - Loading from jar: 
> /home/ori7/.m2/repository/org/apache/camel/camel-activemq/1.1.0/camel-activemq-1.1.0.jar
> 11:33:01,563 DEBUG DefaultPackageScanClassResolver:243 - Loading from jar: 
> /home/ori7/.m2/repository/org/apache/activemq/activemq-camel/5.2.0/activemq-camel-5.2.0.jar
> 11:33:01,615 DEBUG DefaultPackageScanClassResolver:90 - Found: [class 
> org.apache.camel.component.file.GenericFileConverter, class 
> org.apache.camel.converter.CamelConverter, class 
> org.apache.camel.converter.CollectionConverter, class 
> org.apache.camel.converter.IOConverter, class 
> org.apache.camel.converter.NIOConverter, class 
> org.apache.camel.converter.ObjectConverter, class 
> org.apache.camel.converter.jaxp.DomConverter, class 
> org.apache.camel.converter.jaxp.StaxConverter, class 
> org.apache.camel.converter.jaxp.StreamSourceConverter, class 
> org.apache.camel.converter.jaxp.XmlConverter, class 
> org.apache.camel.converter.stream.StreamCacheConverter, class 
> org.apache.camel.component.activemq.ActiveMQConverter, class 
> org.apache.activemq.camel.converter.ActiveMQConverter, class 
> org.apache.activemq.camel.converter.ActiveMQMessageConverter]
> 11:33:01,619 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.component.file.GenericFileConverter
> 11:33:01,625 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.CamelConverter
> 11:33:01,627 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.CollectionConverter
> 11:33:01,629 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.IOConverter
> 11:33:01,632 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.NIOConverter
> 11:33:01,634 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.ObjectConverter
> 11:33:01,635 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.jaxp.DomConverter
> 11:33:01,636 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.jaxp.StaxConverter
> 11:33:01,638 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.jaxp.StreamSourceConverter
> 11:33:01,639 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.jaxp.XmlConverter
> 11:33:01,644 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.converter.stream.StreamCacheConverter
> 11:33:01,646 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.camel.component.activemq.ActiveMQConverter
> 11:33:01,646 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.activemq.camel.converter.ActiveMQConverter
> 11:33:01,647  WARN DefaultTypeConverter:197 - Overriding type converter from: 
> StaticMethodTypeConverter: public static 
> org.apache.activemq.command.ActiveMQDestination 
> org.apache.camel.component.activemq.ActiveMQConverter.toDestination(java.lang.String)
>  to: StaticMethodTypeConverter: public static 
> org.apache.activemq.command.ActiveMQDestination 
> org.apache.activemq.camel.converter.ActiveMQConverter.toDestination(java.lang.String)
> 11:33:01,648 DEBUG AnnotationTypeConverterLoader:65 - Loading converter 
> class: org.apache.activemq.camel.converter.ActiveMQMessageConverter
> temp-queue://ID:niso-55060-1246264380379-0:1:1
> 11:33:20,552 DEBUG InactivityMonitor:99 - 10000 ms elapsed since last write 
> check.
> 11:33:20,877 DEBUG InactivityMonitor:99 - 9999 ms elapsed since last write 
> check.
> 11:33:21,080 DEBUG JmsProducer:239 - Future timed out: 
> java.util.concurrent.TimeoutException
> java.util.concurrent.TimeoutException
>         at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:228)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:91)
>         at 
> org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:231)
>         at 
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:165)
>         at 
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:151)
>         at 
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:136)
>         at 
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:150)
>         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:104)
>         at 
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
>         at 
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:89)
>         at com.mycompany.CamelExample.App.main(App.java:57)
> 11:33:21,855 DEBUG DefaultTimeoutMap:128 - Evicting inactive request for 
> correlationID: Entry for key: ID-niso-53590-1246264380744-2-0
> 11:33:30,552 DEBUG InactivityMonitor:99 - 10000 ms elapsed since last write 
> check.
> 11:33:30,877 DEBUG InactivityMonitor:99 - 10000 ms elapsed since last write 
> check.
> 11:33:40,552 DEBUG InactivityMonitor:99 - 10000 ms elapsed since last write 
> check.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to