You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sachin <sa...@gmail.com> on 2011/06/22 08:04:11 UTC

Request Response with Websphere MQ with JTA

Hi, 

I am trying to achieve JMS request response scenario in XA with websphere
and websphere mq. 
I am not using routes. I am using JmsProducer..process(ExchangePattern
exchange) with exchangePattern set to InOut. Since JMS will not send any
messages until a commit is performed, the server side won't receive anything
at all until the transaction commits, a transaction commit has to happen
after sending request. 

This is the configuration i have done in camel-context.xml. But no
transaction commit is not happening for the message to go till consumer. 

        <camelContext id="camel"
xmlns="http://camel.apache.org/schema/spring">
                <endpoint id="requestQueue1"
uri="webspheremq:queue:ReqQueue?exchangePattern=InOut"/>  
  </camelContext>
      
        <jee:jndi-lookup id="connectionFactory" jndi-name="QCF">
    <jee:environment>
     
java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory 
      java.naming.provider.url=iiop://localhost:2809/ 
    </jee:environment>
  </jee:jndi-lookup>
                        
    <bean id="webspheremq"
class="org.apache.camel.component.jms.JmsComponent">
                <property name="configuration">
                        <bean
class="org.apache.camel.component.jms.JmsConfiguration">
                                <property name="connectionFactory"
ref="connectionFactory" />
                                <property name="transacted" value="true" />
                                <property name="concurrentConsumers"
value="1" />
                                <property name="transactedInOut"
value="false" />
                                <property name="cacheLevelName"
value="CACHE_NONE"/>
                        </bean>
                </property>
     </bean>

Should I do any more configurations to achieve request response? 

--
View this message in context: http://camel.465427.n5.nabble.com/Request-Response-with-Websphere-MQ-with-JTA-tp4513041p4513041.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Request Response with Websphere MQ with JTA

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

You have not specified your camel route in the original listing above. It is
hard to see what might be going on without this... 

Also if you use ActiveMQ, which is not apparent, is it not possible for you
to do your transaction along the Camel route since you are using
ExchangePattern.InOut and wrap the entire Websphere invocation around the
transaction?

I am no Websphere expert but does it require you to have a replyTo queue to
receive responses with a correlation Id. ActiveMQ supports responses via a
temporary Queue and hence can be elegantly sending/receiving messages at the
same endpoint. This may not be the case with WebsphereMQ, though, please do
not hold me to that.

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
CamelOne 2011: http://fusesource.com/camel2011 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/Request-Response-with-Websphere-MQ-with-JTA-tp4513041p4525731.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Request Response with Websphere MQ with JTA

Posted by Sachin <sa...@gmail.com>.
Yes I have tried transactedInOut= true option.
Transaction is not getting committed anywhere. :(

--
View this message in context: http://camel.465427.n5.nabble.com/Request-Response-with-Websphere-MQ-with-JTA-tp4513041p4519986.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Request Response with Websphere MQ with JTA

Posted by Christian Müller <ch...@gmail.com>.
Did you allready tried transactedInOut=true?
Am 22.06.2011 08:04 schrieb "Sachin" <sa...@gmail.com>:
> Hi,
>
> I am trying to achieve JMS request response scenario in XA with websphere
> and websphere mq.
> I am not using routes. I am using JmsProducer..process(ExchangePattern
> exchange) with exchangePattern set to InOut. Since JMS will not send any
> messages until a commit is performed, the server side won't receive
anything
> at all until the transaction commits, a transaction commit has to happen
> after sending request.
>
> This is the configuration i have done in camel-context.xml. But no
> transaction commit is not happening for the message to go till consumer.
>
> <camelContext id="camel"
> xmlns="http://camel.apache.org/schema/spring">
> <endpoint id="requestQueue1"
> uri="webspheremq:queue:ReqQueue?exchangePattern=InOut"/>
> </camelContext>
>
> <jee:jndi-lookup id="connectionFactory" jndi-name="QCF">
> <jee:environment>
>
>
java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory

> java.naming.provider.url=iiop://localhost:2809/
> </jee:environment>
> </jee:jndi-lookup>
>
> <bean id="webspheremq"
> class="org.apache.camel.component.jms.JmsComponent">
> <property name="configuration">
> <bean
> class="org.apache.camel.component.jms.JmsConfiguration">
> <property name="connectionFactory"
> ref="connectionFactory" />
> <property name="transacted" value="true" />
> <property name="concurrentConsumers"
> value="1" />
> <property name="transactedInOut"
> value="false" />
> <property name="cacheLevelName"
> value="CACHE_NONE"/>
> </bean>
> </property>
> </bean>
>
> Should I do any more configurations to achieve request response?
>
> --
> View this message in context:
http://camel.465427.n5.nabble.com/Request-Response-with-Websphere-MQ-with-JTA-tp4513041p4513041.html
> Sent from the Camel - Users mailing list archive at Nabble.com.