You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tim83 <ti...@roots.be> on 2009/06/15 17:41:21 UTC

Strange behaviour with camel and JMS queues

I'm seeing some strange behaviour with camel 1.6 and camel 1.6.1

First issue relates to the exchange patterns.
I have setup a camel route that takes a message from a JMS queue, processes
the message and sends a message to another queue.

<camel:route>
	<camel:from uri="activemq:queue:source" />
	<!-- some processing occurs here -->
	<camel:to uri="activemq:queue:confirm?disableReplyTo=true"
pattern="InOnly"/>
</camel:route>

I added pattern="InOnly" on my destination but if you look in the info
logging produced by camel, you'll notice that is still using the "OutIn"
pattern ? 
Does anybody know how to solve this issue, as it's quite annoying...

INFO: ID-........./55643-1245079597289/2-0 ->
to(activemq:queue:confirm?disableReplyTo=true), Pattern:OutIn ,
Headers:{JMSXGroupID=null, JMSCorrelationID=xxxxx, JMSType=null,
JMSExpiration=0, JMSMessageID=ID:........49640-1245078470039-0:3:12:1:1,
JMSRedelivered=false, JMSDeliveryMode=2, JMSPriority=4, JMSReplyTo=null,
JMSTimestamp=1245079607451,
JMSDestination=temp-queue://ID:.....-55639-1245079591886-0:0:2} ,
BodyType:java.util.HashMap , Body:{....}} 
15/06/2009 17:26:47 org.apache.camel.component.jms.JmsProducer process

Then camel prints out the following warning message.

WARNING: Disabling JMSReplyTo as this Exchange is not OUT capable:
Exchange[JmsMessage: ActiveMQMapMessage {commandId = 60, responseRequired =
true, messageId = ID:....-49640-1245078470039-0:3:12:1:1,
originalDestination = null, originalTransactionId = null, producerId =
ID:......-49640-1245078470039-0:3:12:1, destination =
temp-queue://ID:......55639-1245079591886-0:0:2, transactionId = null,
expiration = 0, timestamp = 1245079607451, arrival = 0, brokerInTime =
1245079607407, brokerOutTime = 1245079607407, correlationId = xxxxx, replyTo
= null, persistent = true, type = null, priority = 4, groupID = null,
groupSequence = 0, targetConsumerId = null, compressed = false, userID =
null, content = org.apache.activemq.util.ByteSequence@b08658,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true,
droppable = false} ActiveMQMapMessage{ ... ] with destination: confirm

Second issue relates to the number of consumers started by camel
When upgrading from camel 1.6 to camel 1.6.1 I noticed that all of a sudden
I had 2 consumers for each JMS queue despite the fact that I do specify that
I only want one consumer???

    	<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
     	    <property name="connectionFactory" ref="jmsFactory"/>
	    <property name="transactionManager" ref="jmsTransactionManager"/>
	    <property name="transacted" value="true"/>
	    <property name="concurrentConsumers" value="1"/>
	</bean>



Any idea what causing this strange behavior?
And does anybody know how to fix these issues?

Thanks,
Tim
-- 
View this message in context: http://www.nabble.com/Strange-behaviour-with-camel-and-JMS-queues-tp24037119p24037119.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Strange behaviour with camel and JMS queues

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jun 16, 2009 at 12:40 PM, Tim83<ti...@roots.be> wrote:
>
> Hi Claus,
>
>
> Claus Ibsen-2 wrote:
>>
>> I have newer seen a OutIn pattern before?
>> Are you sure its not InOut?
>>
>> You could try with a simpler route, eg without all the processing to
>> see if it works with
>>  a simple
>> from(jms)->to(jms)
>> Maybe something happens during the processing that breaks something.
>>
>> By default a JMS consumer is InOnly if the JMSReplyTo message it
>> consumes is empty/null.
>> So the InOnly should not be needed. But maybe your processing code
>> changes the pattern from InOnly to something else.
>>
>
> I'll let you know once I've done additional testing, but it does print out
> OutIn in my console?!
>
>
> Claus Ibsen-2 wrote:
>>
>>> Second issue relates to the number of consumers started by camel
>>> When upgrading from camel 1.6 to camel 1.6.1 I noticed that all of a
>>> sudden
>>> I had 2 consumers for each JMS queue despite the fact that I do specify
>>> that
>>> I only want one consumer???
>>>
>>>        <bean id="jmsConfig"
>>> class="org.apache.camel.component.jms.JmsConfiguration">
>>>            <property name="connectionFactory" ref="jmsFactory"/>
>>>            <property name="transactionManager"
>>> ref="jmsTransactionManager"/>
>>>            <property name="transacted" value="true"/>
>>>            <property name="concurrentConsumers" value="1"/>
>>>        </bean>
>>>
>>>
>>>
>>> Any idea what causing this strange behavior?
>>> And does anybody know how to fix these issues?
>> You are the first to report something about having multiple consumers.
>> Maybe you route is being loaded twice?
>>
> I think you are correct it seems to the camel routes twice, actually I think
> the camel context is loaded twice.  See logging below.
> Do you need an example project for this? or is it a known issue?
Ah

I think we have it reported already. See this ticket:
http://issues.apache.org/activemq/browse/CAMEL-1711

So you are running Camel as a spring web application?
What container are you using?

>
> 16/06/2009 11:24:34 org.apache.camel.impl.DefaultCamelContext start
> INFO: Apache Camel  (CamelContext:camel) started
> 16/06/2009 11:24:34 org.springframework.web.context.ContextLoader
> initWebApplicationContext
> INFO: Root WebApplicationContext: initialization completed in 8181 ms
> 16/06/2009 11:24:34 org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring FrameworkServlet 'spring'
> 16/06/2009 11:24:34 org.springframework.web.servlet.FrameworkServlet
> initServletBean
> INFO: FrameworkServlet 'spring': initialization started
> 16/06/2009 11:24:34
> org.springframework.context.support.AbstractApplicationContext
> prepareRefresh
> INFO: Refreshing
> org.springframework.web.context.support.XmlWebApplicationContext@1a41860:
> display name [WebApplicationContext for namespace 'spring-servlet']; startup
> date [Tue Jun 16 11:24:34 CEST 2009]; parent:
> org.springframework.web.context.support.XmlWebApplicationContext@19ce47a
> 16/06/2009 11:24:34
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions
> INFO: Loading XML bean definitions from ServletContext resource
> [/WEB-INF/spring-servlet.xml]
> 16/06/2009 11:24:34
> org.springframework.context.support.AbstractApplicationContext
> obtainFreshBeanFactory
> INFO: Bean factory for application context
> [org.springframework.web.context.support.XmlWebApplicationContext@1a41860]:
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1f106ab
> 16/06/2009 11:24:34
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons
> INFO: Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1f106ab:
> defining beans []; parent:
> org.springframework.beans.factory.support.DefaultListableBeanFactory@40bf04
> 16/06/2009 11:24:34 org.apache.camel.impl.DefaultCamelContext start
> INFO: Apache Camel  (CamelContext:camel) started
>
> Tim
> --
> View this message in context: http://www.nabble.com/Strange-behaviour-with-camel-and-JMS-queues-tp24037119p24051738.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Strange behaviour with camel and JMS queues

Posted by Tim83 <ti...@roots.be>.
Hi Claus,


Claus Ibsen-2 wrote:
> 
> I have newer seen a OutIn pattern before?
> Are you sure its not InOut?
> 
> You could try with a simpler route, eg without all the processing to
> see if it works with
>  a simple
> from(jms)->to(jms)
> Maybe something happens during the processing that breaks something.
> 
> By default a JMS consumer is InOnly if the JMSReplyTo message it
> consumes is empty/null.
> So the InOnly should not be needed. But maybe your processing code
> changes the pattern from InOnly to something else.
> 

I'll let you know once I've done additional testing, but it does print out
OutIn in my console?!


Claus Ibsen-2 wrote:
> 
>> Second issue relates to the number of consumers started by camel
>> When upgrading from camel 1.6 to camel 1.6.1 I noticed that all of a
>> sudden
>> I had 2 consumers for each JMS queue despite the fact that I do specify
>> that
>> I only want one consumer???
>>
>>        <bean id="jmsConfig"
>> class="org.apache.camel.component.jms.JmsConfiguration">
>>            <property name="connectionFactory" ref="jmsFactory"/>
>>            <property name="transactionManager"
>> ref="jmsTransactionManager"/>
>>            <property name="transacted" value="true"/>
>>            <property name="concurrentConsumers" value="1"/>
>>        </bean>
>>
>>
>>
>> Any idea what causing this strange behavior?
>> And does anybody know how to fix these issues?
> You are the first to report something about having multiple consumers.
> Maybe you route is being loaded twice?
> 
I think you are correct it seems to the camel routes twice, actually I think
the camel context is loaded twice.  See logging below.
Do you need an example project for this? or is it a known issue?

16/06/2009 11:24:34 org.apache.camel.impl.DefaultCamelContext start
INFO: Apache Camel  (CamelContext:camel) started
16/06/2009 11:24:34 org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 8181 ms
16/06/2009 11:24:34 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'spring'
16/06/2009 11:24:34 org.springframework.web.servlet.FrameworkServlet
initServletBean
INFO: FrameworkServlet 'spring': initialization started
16/06/2009 11:24:34
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.web.context.support.XmlWebApplicationContext@1a41860:
display name [WebApplicationContext for namespace 'spring-servlet']; startup
date [Tue Jun 16 11:24:34 CEST 2009]; parent:
org.springframework.web.context.support.XmlWebApplicationContext@19ce47a
16/06/2009 11:24:34
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource
[/WEB-INF/spring-servlet.xml]
16/06/2009 11:24:34
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.web.context.support.XmlWebApplicationContext@1a41860]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1f106ab
16/06/2009 11:24:34
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1f106ab:
defining beans []; parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@40bf04
16/06/2009 11:24:34 org.apache.camel.impl.DefaultCamelContext start
INFO: Apache Camel  (CamelContext:camel) started

Tim
-- 
View this message in context: http://www.nabble.com/Strange-behaviour-with-camel-and-JMS-queues-tp24037119p24051738.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Strange behaviour with camel and JMS queues

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jun 15, 2009 at 5:41 PM, Tim83<ti...@roots.be> wrote:
>
> I'm seeing some strange behaviour with camel 1.6 and camel 1.6.1
>
> First issue relates to the exchange patterns.
> I have setup a camel route that takes a message from a JMS queue, processes
> the message and sends a message to another queue.
>
> <camel:route>
>        <camel:from uri="activemq:queue:source" />
>        <!-- some processing occurs here -->
>        <camel:to uri="activemq:queue:confirm?disableReplyTo=true"
> pattern="InOnly"/>
> </camel:route>
>
> I added pattern="InOnly" on my destination but if you look in the info
> logging produced by camel, you'll notice that is still using the "OutIn"
> pattern ?
> Does anybody know how to solve this issue, as it's quite annoying...

I have newer seen a OutIn pattern before?
Are you sure its not InOut?

You could try with a simpler route, eg without all the processing to
see if it works with a simple
from(jms)->to(jms)

Maybe something happens during the processing that breaks something.

By default a JMS consumer is InOnly if the JMSReplyTo message it
consumes is empty/null.
So the InOnly should not be needed. But maybe your processing code
changes the pattern from InOnly to something else.


>
> INFO: ID-........./55643-1245079597289/2-0 ->
> to(activemq:queue:confirm?disableReplyTo=true), Pattern:OutIn ,
> Headers:{JMSXGroupID=null, JMSCorrelationID=xxxxx, JMSType=null,
> JMSExpiration=0, JMSMessageID=ID:........49640-1245078470039-0:3:12:1:1,
> JMSRedelivered=false, JMSDeliveryMode=2, JMSPriority=4, JMSReplyTo=null,
> JMSTimestamp=1245079607451,
> JMSDestination=temp-queue://ID:.....-55639-1245079591886-0:0:2} ,
> BodyType:java.util.HashMap , Body:{....}}
> 15/06/2009 17:26:47 org.apache.camel.component.jms.JmsProducer process
>
> Then camel prints out the following warning message.
>
> WARNING: Disabling JMSReplyTo as this Exchange is not OUT capable:
> Exchange[JmsMessage: ActiveMQMapMessage {commandId = 60, responseRequired =
> true, messageId = ID:....-49640-1245078470039-0:3:12:1:1,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:......-49640-1245078470039-0:3:12:1, destination =
> temp-queue://ID:......55639-1245079591886-0:0:2, transactionId = null,
> expiration = 0, timestamp = 1245079607451, arrival = 0, brokerInTime =
> 1245079607407, brokerOutTime = 1245079607407, correlationId = xxxxx, replyTo
> = null, persistent = true, type = null, priority = 4, groupID = null,
> groupSequence = 0, targetConsumerId = null, compressed = false, userID =
> null, content = org.apache.activemq.util.ByteSequence@b08658,
> marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
> size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true,
> droppable = false} ActiveMQMapMessage{ ... ] with destination: confirm
The warning is fixed in the next release - 1.6.2 and 2.0m2.
And the FUSE releases.

>
> Second issue relates to the number of consumers started by camel
> When upgrading from camel 1.6 to camel 1.6.1 I noticed that all of a sudden
> I had 2 consumers for each JMS queue despite the fact that I do specify that
> I only want one consumer???
>
>        <bean id="jmsConfig"
> class="org.apache.camel.component.jms.JmsConfiguration">
>            <property name="connectionFactory" ref="jmsFactory"/>
>            <property name="transactionManager" ref="jmsTransactionManager"/>
>            <property name="transacted" value="true"/>
>            <property name="concurrentConsumers" value="1"/>
>        </bean>
>
>
>
> Any idea what causing this strange behavior?
> And does anybody know how to fix these issues?
You are the first to report something about having multiple consumers.
Maybe you route is being loaded twice?

You are welcome to create a small project that demonstrates the issues
you have a and submit it to a JIRA ticket.
Then we can take a look at it.

>
> Thanks,
> Tim
> --
> View this message in context: http://www.nabble.com/Strange-behaviour-with-camel-and-JMS-queues-tp24037119p24037119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus