You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by damu <to...@yahoo.com> on 2013/10/15 23:38:54 UTC

How to check if 'jms.useAsyncSend=true' is set in an inbound message?

Hi all,

We are using the embedded activemq broker within Fuse ESB (7.1.0) with
consumers co-located .

The producer client is deployed on a remote GlassFish server. It uses
activeMQ resource adapter (5.6.0) along with spring jms template. The client
publish messages to different queues. I want some of the messages (going to
a given queue) to use jms.useAsyncSend=true where as the other messages
should use the default. I see below options

1) I can't append the the option 'jms.useAsyncSend=true' in the resource
adapter URL because that will enforce it for all messages. 

2) The JNDI look-up for the connection factory is returning an instance of
'org.apache.activemq*.ra.*ActiveMQConnectionFactory'. I was actually
expecting an instance of org.apache.activemq.ActiveMQConnectionFactory,
which would have allowed me to use setUseAsyncSend() for the corresponding
jmsTemplate. So I can't use this option as well.

3) I have multiple connection factories configured under the GlassFish
connectors (one for each queue). I am trying to pass the property
'jms.useAsyncSend=true' as an additional property to a particular connection
factory. I am expecting this to be used only for the connections created in
that particular connection pool. Now, having done this I want to verify if
it really worked.

Question 1) Is there a way where I can check in the consumer side if the
property 'useAsyncSend' was set in an inbound message? This is to verify
what I have done at producer side has actually worked. Note that I am using
camel-context to route messages to the end consumers. Is there a way to
check this within the came-context? is there a header or any such thing
corresponding to this?

Question 2) Is there a better way to set 'useAsyncSend' in the producer side
where one resource adapter is used for sending messages to different queues
with different values for 'useAsyncSend'.

I understand that 'useAsyncSend' is an activeMQ specific configuration hence
not available in jmstemplate interface

Appreciate any help on this.

thanks,
Damu






--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-check-if-jms-useAsyncSend-true-is-set-in-an-inbound-message-tp4672842.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to check if 'jms.useAsyncSend=true' is set in an inbound message?

Posted by damu <to...@yahoo.com>.
Thanks much for your reply.

I will try that.

thanks,
Damu



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-check-if-jms-useAsyncSend-true-is-set-in-an-inbound-message-tp4672842p4672966.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to check if 'jms.useAsyncSend=true' is set in an inbound message?

Posted by Gary Tully <ga...@gmail.com>.
I don't think there is an easier way to set asyncSend in your setup.
But to validate it is in use, in your camel context is you can get the
in message and cast to ActiiveMQMessage you can check
org.apache.activemq.command.BaseCommand#isResponseRequired

with asyncSend that will be false.

On 15 October 2013 22:38, damu <to...@yahoo.com> wrote:
>
> Hi all,
>
> We are using the embedded activemq broker within Fuse ESB (7.1.0) with
> consumers co-located .
>
> The producer client is deployed on a remote GlassFish server. It uses
> activeMQ resource adapter (5.6.0) along with spring jms template. The client
> publish messages to different queues. I want some of the messages (going to
> a given queue) to use jms.useAsyncSend=true where as the other messages
> should use the default. I see below options
>
> 1) I can't append the the option 'jms.useAsyncSend=true' in the resource
> adapter URL because that will enforce it for all messages.
>
> 2) The JNDI look-up for the connection factory is returning an instance of
> 'org.apache.activemq*.ra.*ActiveMQConnectionFactory'. I was actually
> expecting an instance of org.apache.activemq.ActiveMQConnectionFactory,
> which would have allowed me to use setUseAsyncSend() for the corresponding
> jmsTemplate. So I can't use this option as well.
>
> 3) I have multiple connection factories configured under the GlassFish
> connectors (one for each queue). I am trying to pass the property
> 'jms.useAsyncSend=true' as an additional property to a particular connection
> factory. I am expecting this to be used only for the connections created in
> that particular connection pool. Now, having done this I want to verify if
> it really worked.
>
> Question 1) Is there a way where I can check in the consumer side if the
> property 'useAsyncSend' was set in an inbound message? This is to verify
> what I have done at producer side has actually worked. Note that I am using
> camel-context to route messages to the end consumers. Is there a way to
> check this within the came-context? is there a header or any such thing
> corresponding to this?
>
> Question 2) Is there a better way to set 'useAsyncSend' in the producer side
> where one resource adapter is used for sending messages to different queues
> with different values for 'useAsyncSend'.
>
> I understand that 'useAsyncSend' is an activeMQ specific configuration hence
> not available in jmstemplate interface
>
> Appreciate any help on this.
>
> thanks,
> Damu
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-check-if-jms-useAsyncSend-true-is-set-in-an-inbound-message-tp4672842.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com