You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jaya_srini <jy...@Hotmail.com> on 2008/05/09 08:51:35 UTC

TransportListener question

Hi


Is TransportListener only meant to be used with Failover Transport? i.e if I
use it with tcp transport (without failover) will I be notified if the
broker shuts down and comes back up? The reason we can't use failover is
because we would also like to use Async Sends which is not possible with the
failover transport.

thanks!
jaya
-- 
View this message in context: http://www.nabble.com/TransportListener-question-tp17142309s2354p17142309.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: TransportListener question

Posted by jaya_srini <jy...@Hotmail.com>.
given what I have said below, I am wondering if the following will work

The JMS client connects to the broker with the following conenction URI
(without async send parameter)

failover:(tcp://localhost:61616?wireFormat.maxInactivityDuration=-1)

In the code when I create the connection I set the async send to be true
using the setUseAsyncSend() API? Or will this parameter be ignored if the
transport is failover?


jaya_srini wrote:
> 
> Well, that's the problem. When we use jms.useAsyncSend in the connection
> URI with the failover transpoert we can't even start the JMS client. It
> hangs when it's trying to create the connection to the broker. We are
> using Active-MQ 5.0.0. These are the errors we see in the logs pertaining
> to ActiveMQ
> 
> *DEBUG 08:06:34.296,ActiveMQ
> Task,(org.apache.activemq.transport.failover.FailoverTransport:136)> 
> Connect fail to:
> tcp://localhost:61616?jms.useAsyncSend=true&wireFormat.maxInactivityDuration=-1,
> reason: java.lang.IllegalArgumentException: Invalid connect parameters:
> {jms.useAsyncSend=true}
> *DEBUG 08:06:34.296,ActiveMQ
> Task,(org.apache.activemq.transport.failover.FailoverTransport:152)> 
> Waiting 10 ms before attempting connection. 
> 
> which is what made me think that useAsyncSend is not possible to use with
> failover. If I remove the failover transport client is able to connect
> successfully but then we lose the features we wanted with failover.
> 
> The connection URI looks like this
> 
> failover:(tcp://localhost:61616?jms.useAsyncSend=true&wireFormat.maxInactivityDuration=-1)
> 
> thanks
> jaya
> 
> James.Strachan wrote:
>> 
>> 2008/5/9 jaya_srini <jy...@hotmail.com>:
>>>
>>>  Thanks so much for the responses. Can you tell me how I can use Async
>>> Sends
>>>  with the Failover transport? I tried the jms.useAsyncSend parameter in
>>> the
>>>  connection URI but that just causes the client to hang.
>> 
>> Was the client connected to the broker at the time? The restriction
>> with all transports is the client must be connected to a broker to
>> create connections / sessions / producers / consumers.
>> 
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> Open Source Integration
>> http://open.iona.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/TransportListener-question-tp17142309s2354p17150502.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: TransportListener question

Posted by jaya_srini <jy...@Hotmail.com>.
Well, that's the problem. When we use jms.useAsyncSend in the connection URI
with the failover transpoert we can't even start the JMS client. It hangs
when it's trying to create the connection to the broker. We are using
Active-MQ 5.0.0. These are the errors we see in the logs pertaining to
ActiveMQ

*DEBUG 08:06:34.296,ActiveMQ
Task,(org.apache.activemq.transport.failover.FailoverTransport:136)> 
Connect fail to:
tcp://localhost:61616?jms.useAsyncSend=true&wireFormat.maxInactivityDuration=-1,
reason: java.lang.IllegalArgumentException: Invalid connect parameters:
{jms.useAsyncSend=true}
*DEBUG 08:06:34.296,ActiveMQ
Task,(org.apache.activemq.transport.failover.FailoverTransport:152)> 
Waiting 10 ms before attempting connection. 

which is what made me think that useAsyncSend is not possible to use with
failover. If I remove the failover transport client is able to connect
successfully but then we lose the features we wanted with failover.

The connection URI looks like this

failover:(tcp://localhost:61616?jms.useAsyncSend=true&wireFormat.maxInactivityDuration=-1)

thanks
jaya

James.Strachan wrote:
> 
> 2008/5/9 jaya_srini <jy...@hotmail.com>:
>>
>>  Thanks so much for the responses. Can you tell me how I can use Async
>> Sends
>>  with the Failover transport? I tried the jms.useAsyncSend parameter in
>> the
>>  connection URI but that just causes the client to hang.
> 
> Was the client connected to the broker at the time? The restriction
> with all transports is the client must be connected to a broker to
> create connections / sessions / producers / consumers.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/TransportListener-question-tp17142309s2354p17150125.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: TransportListener question

Posted by James Strachan <ja...@gmail.com>.
2008/5/9 jaya_srini <jy...@hotmail.com>:
>
>  Thanks so much for the responses. Can you tell me how I can use Async Sends
>  with the Failover transport? I tried the jms.useAsyncSend parameter in the
>  connection URI but that just causes the client to hang.

Was the client connected to the broker at the time? The restriction
with all transports is the client must be connected to a broker to
create connections / sessions / producers / consumers.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: TransportListener question

Posted by jaya_srini <jy...@Hotmail.com>.
Thanks so much for the responses. Can you tell me how I can use Async Sends
with the Failover transport? I tried the jms.useAsyncSend parameter in the
connection URI but that just causes the client to hang. 

Is there any other way to do this? If we can use failover with async sends
that would be really great for us!

jaya


James.Strachan wrote:
> 
> 2008/5/9 jaya_srini <jy...@hotmail.com>:
>>
>>  Hi
>>
>>
>>  Is TransportListener only meant to be used with Failover Transport?
> 
> Yeah - as if you're not using failover, the JMS connection will fail
> if there is a transport problem; so listening doesn't add much value
> if your JMS connection is dead :)
> 
>>  i.e if I
>>  use it with tcp transport (without failover) will I be notified if the
>>  broker shuts down and comes back up?
> 
> Without failover you'll know when it dies - but it won't ever come
> back up. Being able to reconnect to a broker when it comes back up (or
> the network issue that caused the socket to fail is fixed) is exactly
> what failover does.
> 
>>  The reason we can't use failover is
>>  because we would also like to use Async Sends which is not possible with
>> the
>>  failover transport.
> 
> Yes it is.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/TransportListener-question-tp17142309s2354p17143541.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: TransportListener question

Posted by James Strachan <ja...@gmail.com>.
2008/5/9 jaya_srini <jy...@hotmail.com>:
>
>  Hi
>
>
>  Is TransportListener only meant to be used with Failover Transport?

Yeah - as if you're not using failover, the JMS connection will fail
if there is a transport problem; so listening doesn't add much value
if your JMS connection is dead :)

>  i.e if I
>  use it with tcp transport (without failover) will I be notified if the
>  broker shuts down and comes back up?

Without failover you'll know when it dies - but it won't ever come
back up. Being able to reconnect to a broker when it comes back up (or
the network issue that caused the socket to fail is fixed) is exactly
what failover does.

>  The reason we can't use failover is
>  because we would also like to use Async Sends which is not possible with the
>  failover transport.

Yes it is.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com