activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <>
Subject Re: Broker config
Date Tue, 04 Apr 2006 23:28:38 GMT

To try and answer some of your questions:

Naby wrote:

>Thx James.
>I have some questions about it
>a) Is a message published to the failover broker if a producer gets no
>connection to the broker?
Yes. As long as the failover connection of the client is able to connect 
to the secondaty broker. What failover does is detect when a connection 
has failed and try to establish a connection with other brokers in the 
failover list. i.e. if you have 
failover:(tcp://brokerA:61616,tcp://brokerB:61616), and a producer 
publishes to brokerA while it is down, the connection will fail and it 
will try to connect to brokerB and send the message there. You don't 
have to do anything special in the client side except specify the 
reconnection options like how many times it should try to connect to any 
brokers in the list or the interval between each reconnection attempt, etc.

>b) How can i check if a broker fails?
I haven't tried it yet, but I think you could register a 
TransportListener to your connection to be notified of transport events 
like transportInterrupted, transportResumed, etc. Although I don't think 
its a guarantee that the broker had failed. It could be that the 
connection has failed for some other reason. You could also use JMX in 
AMQ 4.x to monitor the state of the broker.

>c) How often does it happen that a broker fails/dies forever?
I can't say really depends on a lot of factors I think. :-)

>Let me ask another question.
>We are running web clients. There is a time lack between the start of these
>clients and the registration to the topics but we want the clients to get
>the messages which are published within this time, but not messages
>published before the start.
>What do you think is a good technic/configuration to solve this problem? 
I don't know if this would work for you, but AMQ 4.x has a 
TimedSubscriptionRecoveryPolicy, which basically allows you to specify 
how long messages should be cached in memory before being discarded. If 
you use this, you should also make your consumers retroactive.

Hope any of it helps. :-)

>View this message in context:
>Sent from the ActiveMQ - User forum at

View raw message