You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mta38 <mt...@orange-ftgroup.com> on 2008/11/14 09:42:31 UTC

JmsExchange xml InOut pattern

Hi all,
I have some little problem with use of JmsExchange.

I have the following route:

<route>
	<from ref="jmsRequestQueue" />	
	<process ref="myProcessor" />
	<to ref="jmsResponseQueue" />
</route>

Where  jmsRequestQueue and jmsResponseQueue are define using jndi template 

<bean id="myJndiTemplate"
		class="org.springframework.jndi.JndiTemplate">
		<property name="environment">
			<props>
				<prop key="java.naming.factory.initial">
					${java.naming.factory.initial}
				</prop>
			</props>
		</property>
</bean>

<bean id="connectionFactory"
		class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiTemplate">
			<ref bean="myJndiTemplate" />
		</property>
		<property name="jndiName">
			<value>ConnectionFactory</value>
		</property>
</bean>


<bean id="jmsQueue" class="org.apache.camel.component.jms.JmsComponent">
		<property name="connectionFactory" ref="connectionFactory" />
		<property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE"/>
	</bean>

<endpoint id="jmsRequestQueue" uri="jmsQueue:queue:${queue.RequestQueue}" />

And  queue.RequestQueue is define in a property file.
java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory

My questions are:

1 - How to define my JmsExchange (in xml config file) as an "InOut" Exchange
pattern? (When I test this route, I can see that the value of
ExchangePattern is "InOnly"). 

2- Why my JmsReplyTo destination in the exchange object is null?

Any help are welcome,
Mta38

-- 
View this message in context: http://www.nabble.com/JmsExchange-xml-InOut-pattern-tp20496686s22882p20496686.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JmsExchange xml InOut pattern

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think you can set the exchange pattern on the endpoint as a URI option

<endpoint id="jmsRequestQueue"
uri="jmsQueue:queue:${queue.RequestQueue}?exchangePattern=InOut" />

There is a ticket in JIRA:
https://issues.apache.org/activemq/browse/CAMEL-486

That points to some discussions about this issue.



/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Fri, Nov 14, 2008 at 9:42 AM, mta38 <mt...@orange-ftgroup.com> wrote:
>
> Hi all,
> I have some little problem with use of JmsExchange.
>
> I have the following route:
>
> <route>
>        <from ref="jmsRequestQueue" />
>        <process ref="myProcessor" />
>        <to ref="jmsResponseQueue" />
> </route>
>
> Where  jmsRequestQueue and jmsResponseQueue are define using jndi template
>
> <bean id="myJndiTemplate"
>                class="org.springframework.jndi.JndiTemplate">
>                <property name="environment">
>                        <props>
>                                <prop key="java.naming.factory.initial">
>                                        ${java.naming.factory.initial}
>                                </prop>
>                        </props>
>                </property>
> </bean>
>
> <bean id="connectionFactory"
>                class="org.springframework.jndi.JndiObjectFactoryBean">
>                <property name="jndiTemplate">
>                        <ref bean="myJndiTemplate" />
>                </property>
>                <property name="jndiName">
>                        <value>ConnectionFactory</value>
>                </property>
> </bean>
>
>
> <bean id="jmsQueue" class="org.apache.camel.component.jms.JmsComponent">
>                <property name="connectionFactory" ref="connectionFactory" />
>                <property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE"/>
>        </bean>
>
> <endpoint id="jmsRequestQueue" uri="jmsQueue:queue:${queue.RequestQueue}" />
>
> And  queue.RequestQueue is define in a property file.
> java.naming.factory.initial =
> org.apache.activemq.jndi.ActiveMQInitialContextFactory
>
> My questions are:
>
> 1 - How to define my JmsExchange (in xml config file) as an "InOut" Exchange
> pattern? (When I test this route, I can see that the value of
> ExchangePattern is "InOnly").
>
> 2- Why my JmsReplyTo destination in the exchange object is null?
>
> Any help are welcome,
> Mta38
>
> --
> View this message in context: http://www.nabble.com/JmsExchange-xml-InOut-pattern-tp20496686s22882p20496686.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>