You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Dingwen Yuan <pd...@gmail.com> on 2007/05/09 05:36:31 UTC

Way to know whether failover client is connecting?

Hi all,

Is there a way to know that a failover ActiveMQ client is now trying to connect to the brokers?

Thank you!




Dingwen Yuan
2007-05-09

Re: Way to know whether failover client is connecting?

Posted by Adrian Co <ac...@exist.com>.
afaik, yes.

Dingwen Yuan wrote:
> It works. Another question for XML configuration: 
>
> suppose I have the following network connectors config.
>     <networkConnectors>
>       <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)" />
>       <networkConnector name="host3" uri="static://(tcp://host3:61616)" />
>     </networkConnectors>
> Does it mean that the broker has two network connectors, one will connect to either host1 or host2, while the other will always try to connect to host3.
>
> So many questions, sorry for the bothering.
>
>
>
> Dingwen Yuan
> 2007-05-09
>
>
>
> 发件人: Adrian Co
> 发送时间: 2007-05-09 15:35:55
> 收件人: users@activemq.apache.org
> 抄送: 
> 主题: Re: Way to know whether failover client is connecting?
>
> Network connections at the moment are one-way afaik. You would need to
> create a network connection from the remote broker to the embedded
> broker to be able to receive messages to the embedded broker. I think
> there's a jira to make it two-way, but I can't remember the number... sorry.
>
> Dingwen Yuan wrote:
>   
>> Thank you Adrian,
>>
>> I have tried as you suggested, it worked for Topic, but not queue.
>> The following is the code for embedded broker.  As you see, I have connected embedded broker to the broker at 61616. When I send a topic, the client connected to 61616 can receive it, but I can not recieved the queue message sent by the client on 61616.
>>     embeddedBroker = new BrokerService();
>>    NetworkConnector connector = embeddedBroker.addNetworkConnector("static:(tcp://127.0.0.1:61616)");
>>    connector.setNetworkTTL(2);
>>    connector.setDynamicOnly(true);
>>    embeddedBroker.start();
>>
>>
>>
>>
>> Dingwen Yuan
>> 2007-05-09
>>
>>
>>
>> 发件人: Adrian Co
>> 发送时间: 2007-05-09 13:27:02
>> 收件人: users@activemq.apache.org
>> 抄送: 
>> 主题: Re: Way to know whether failover client is connecting?
>>
>> A FailoverListener would be interesting, but afaik, its not provided.
>>
>> Dingwen Yuan wrote:
>>   
>>     
>>> But what is the programmable way to know it?
>>>
>>>
>>>
>>>
>>> Dingwen Yuan
>>> 2007-05-09
>>>
>>>
>>>
>>> 发件人: spiderman2
>>> 发送时间: 2007-05-09 11:43:31
>>> 收件人: users@activemq.apache.org
>>> 抄送: 
>>> 主题: Re: Way to know whether failover client is connecting?
>>>
>>>
>>> When I kill the broker to test a failover, I believe the Consumer's logs show
>>> it trying to failover to another broker.
>>>
>>>
>>>
>>> Dingwen Yuan wrote:
>>>   
>>>     
>>>       
>>>> Hi all,
>>>>
>>>> Is there a way to know that a failover ActiveMQ client is now trying to
>>>> connect to the brokers?
>>>>
>>>> Thank you!
>>>>
>>>>
>>>>
>>>>
>>>> Dingwen Yuan
>>>> 2007-05-09
>>>>
>>>>
>>>>     
>>>>       
>>>>         
>>>   
>>>     
>>>       
>>
>>   
>>     
>
> !DSPAM:507,46418aa429461205410814!
>
>   


Re: Re: Way to know whether failover client is connecting?

Posted by Dingwen Yuan <pd...@gmail.com>.
It works. Another question for XML configuration: 

suppose I have the following network connectors config.
    <networkConnectors>
      <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)" />
      <networkConnector name="host3" uri="static://(tcp://host3:61616)" />
    </networkConnectors>
Does it mean that the broker has two network connectors, one will connect to either host1 or host2, while the other will always try to connect to host3.

So many questions, sorry for the bothering.



Dingwen Yuan
2007-05-09



发件人: Adrian Co
发送时间: 2007-05-09 15:35:55
收件人: users@activemq.apache.org
抄送: 
主题: Re: Way to know whether failover client is connecting?

Network connections at the moment are one-way afaik. You would need to
create a network connection from the remote broker to the embedded
broker to be able to receive messages to the embedded broker. I think
there's a jira to make it two-way, but I can't remember the number... sorry.

Dingwen Yuan wrote:
> Thank you Adrian,
>
> I have tried as you suggested, it worked for Topic, but not queue.
> The following is the code for embedded broker.  As you see, I have connected embedded broker to the broker at 61616. When I send a topic, the client connected to 61616 can receive it, but I can not recieved the queue message sent by the client on 61616.
>     embeddedBroker = new BrokerService();
>    NetworkConnector connector = embeddedBroker.addNetworkConnector("static:(tcp://127.0.0.1:61616)");
>    connector.setNetworkTTL(2);
>    connector.setDynamicOnly(true);
>    embeddedBroker.start();
>
>
>
>
> Dingwen Yuan
> 2007-05-09
>
>
>
> 发件人: Adrian Co
> 发送时间: 2007-05-09 13:27:02
> 收件人: users@activemq.apache.org
> 抄送: 
> 主题: Re: Way to know whether failover client is connecting?
>
> A FailoverListener would be interesting, but afaik, its not provided.
>
> Dingwen Yuan wrote:
>   
> > But what is the programmable way to know it?
> >
> >
> >
> >
> > Dingwen Yuan
> > 2007-05-09
> >
> >
> >
> > 发件人: spiderman2
> > 发送时间: 2007-05-09 11:43:31
> > 收件人: users@activemq.apache.org
> > 抄送: 
> > 主题: Re: Way to know whether failover client is connecting?
> >
> >
> > When I kill the broker to test a failover, I believe the Consumer's logs show
> > it trying to failover to another broker.
> >
> >
> >
> > Dingwen Yuan wrote:
> >   
> >     
> > > Hi all,
> > >
> > > Is there a way to know that a failover ActiveMQ client is now trying to
> > > connect to the brokers?
> > >
> > > Thank you!
> > >
> > >
> > >
> > >
> > > Dingwen Yuan
> > > 2007-05-09
> > >
> > >
> > >     
> > >       
> >   
> >     
>
> !DSPAM:507,46417008227071855215190!
>
>   

Re: Way to know whether failover client is connecting?

Posted by Adrian Co <ac...@exist.com>.
Network connections at the moment are one-way afaik. You would need to
create a network connection from the remote broker to the embedded
broker to be able to receive messages to the embedded broker. I think
there's a jira to make it two-way, but I can't remember the number... sorry.

Dingwen Yuan wrote:
> Thank you Adrian,
>
> I have tried as you suggested, it worked for Topic, but not queue.
> The following is the code for embedded broker.  As you see, I have connected embedded broker to the broker at 61616. When I send a topic, the client connected to 61616 can receive it, but I can not recieved the queue message sent by the client on 61616.
>     embeddedBroker = new BrokerService();
>    NetworkConnector connector = embeddedBroker.addNetworkConnector("static:(tcp://127.0.0.1:61616)");
>    connector.setNetworkTTL(2);
>    connector.setDynamicOnly(true);
>    embeddedBroker.start();
>
>
>
>
> Dingwen Yuan
> 2007-05-09
>
>
>
> 发件人: Adrian Co
> 发送时间: 2007-05-09 13:27:02
> 收件人: users@activemq.apache.org
> 抄送: 
> 主题: Re: Way to know whether failover client is connecting?
>
> A FailoverListener would be interesting, but afaik, its not provided.
>
> Dingwen Yuan wrote:
>   
>> But what is the programmable way to know it?
>>
>>
>>
>>
>> Dingwen Yuan
>> 2007-05-09
>>
>>
>>
>> 发件人: spiderman2
>> 发送时间: 2007-05-09 11:43:31
>> 收件人: users@activemq.apache.org
>> 抄送: 
>> 主题: Re: Way to know whether failover client is connecting?
>>
>>
>> When I kill the broker to test a failover, I believe the Consumer's logs show
>> it trying to failover to another broker.
>>
>>
>>
>> Dingwen Yuan wrote:
>>   
>>     
>>> Hi all,
>>>
>>> Is there a way to know that a failover ActiveMQ client is now trying to
>>> connect to the brokers?
>>>
>>> Thank you!
>>>
>>>
>>>
>>>
>>> Dingwen Yuan
>>> 2007-05-09
>>>
>>>
>>>     
>>>       
>>   
>>     
>
> !DSPAM:507,46417008227071855215190!
>
>   


Re: Re: Way to know whether failover client is connecting?

Posted by Dingwen Yuan <pd...@gmail.com>.
Thank you Adrian,

I have tried as you suggested, it worked for Topic, but not queue.
The following is the code for embedded broker.  As you see, I have connected embedded broker to the broker at 61616. When I send a topic, the client connected to 61616 can receive it, but I can not recieved the queue message sent by the client on 61616.
    embeddedBroker = new BrokerService();
   NetworkConnector connector = embeddedBroker.addNetworkConnector("static:(tcp://127.0.0.1:61616)");
   connector.setNetworkTTL(2);
   connector.setDynamicOnly(true);
   embeddedBroker.start();




Dingwen Yuan
2007-05-09



发件人: Adrian Co
发送时间: 2007-05-09 13:27:02
收件人: users@activemq.apache.org
抄送: 
主题: Re: Way to know whether failover client is connecting?

A FailoverListener would be interesting, but afaik, its not provided.

Dingwen Yuan wrote:
> But what is the programmable way to know it?
>
>
>
>
> Dingwen Yuan
> 2007-05-09
>
>
>
> 发件人: spiderman2
> 发送时间: 2007-05-09 11:43:31
> 收件人: users@activemq.apache.org
> 抄送: 
> 主题: Re: Way to know whether failover client is connecting?
>
>
> When I kill the broker to test a failover, I believe the Consumer's logs show
> it trying to failover to another broker.
>
>
>
> Dingwen Yuan wrote:
>   
> > Hi all,
> >
> > Is there a way to know that a failover ActiveMQ client is now trying to
> > connect to the brokers?
> >
> > Thank you!
> >
> >
> >
> >
> > Dingwen Yuan
> > 2007-05-09
> >
> >
> >     
>
>   

Re: Way to know whether failover client is connecting?

Posted by Adrian Co <ac...@exist.com>.
A FailoverListener would be interesting, but afaik, its not provided.

Dingwen Yuan wrote:
> But what is the programmable way to know it?
>
>
>
>
> Dingwen Yuan
> 2007-05-09
>
>
>
> 发件人: spiderman2
> 发送时间: 2007-05-09 11:43:31
> 收件人: users@activemq.apache.org
> 抄送: 
> 主题: Re: Way to know whether failover client is connecting?
>
>
> When I kill the broker to test a failover, I believe the Consumer's logs show
> it trying to failover to another broker.
>
>
>
> Dingwen Yuan wrote:
>   
>> Hi all,
>>
>> Is there a way to know that a failover ActiveMQ client is now trying to
>> connect to the brokers?
>>
>> Thank you!
>>
>>
>>
>>
>> Dingwen Yuan
>> 2007-05-09
>>
>>
>>     
>
>   


Re: Re: Way to know whether failover client is connecting?

Posted by James Strachan <ja...@gmail.com>.
On 5/8/07, Dingwen Yuan <pd...@gmail.com> wrote:
> But what is the programmable way to know it?

Try the TransportListener which gets notified when connections to a
broker start/stop/fail etc

http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnection.html#addTransportListener(org.apache.activemq.transport.TransportListener)

http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/transport/TransportListener.html


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

Re: Re: Way to know whether failover client is connecting?

Posted by Dingwen Yuan <pd...@gmail.com>.
But what is the programmable way to know it?




Dingwen Yuan
2007-05-09



发件人: spiderman2
发送时间: 2007-05-09 11:43:31
收件人: users@activemq.apache.org
抄送: 
主题: Re: Way to know whether failover client is connecting?


When I kill the broker to test a failover, I believe the Consumer's logs show
it trying to failover to another broker.



Dingwen Yuan wrote:
> 
> Hi all,
> 
> Is there a way to know that a failover ActiveMQ client is now trying to
> connect to the brokers?
> 
> Thank you!
> 
> 
> 
> 
> Dingwen Yuan
> 2007-05-09
> 
> 

-- 
View this message in context: http://www.nabble.com/Way-to-know-whether-failover-client-is-connecting--tf3713515s2354.html#a10388010
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Way to know whether failover client is connecting?

Posted by spiderman2 <sh...@bridgewatersystems.com>.
When I kill the broker to test a failover, I believe the Consumer's logs show
it trying to failover to another broker.



Dingwen Yuan wrote:
> 
> Hi all,
> 
> Is there a way to know that a failover ActiveMQ client is now trying to
> connect to the brokers?
> 
> Thank you!
> 
> 
> 
> 
> Dingwen Yuan
> 2007-05-09
> 
> 

-- 
View this message in context: http://www.nabble.com/Way-to-know-whether-failover-client-is-connecting--tf3713515s2354.html#a10388010
Sent from the ActiveMQ - User mailing list archive at Nabble.com.