activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Teira <>
Subject QueueBridge and remote broker reconnections
Date Wed, 27 Sep 2006 13:48:16 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Looking at the code in <b>DestinationBridge</b>
(, I see that when the deliver of a
message to the remote broker fails, there's a counter implemented as
the var 'attempt' that seems to be thought to mark fails and try to
restart the producer.<br>
But, shouldn't that variable be a member of the <b>DestinationBridge </b>class
instead of a local variable of the <b>onMessage </b>member method? In
this way, the var is always initialized to zero for every onMessage
call. So, restartProducer is never called:<br>
&nbsp;&nbsp;&nbsp; public void onMessage(Message message) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (started.get() &amp;&amp;
message != null) {<br>
int attempt = 0;<br>
try {<br>
if (attempt &gt; 0) {<br>
In my tests, I've tryed changing the var 'attempt' to be an object
member. Now, restartProducer() is called but it seems that the new
connection is not being used. Looking at the code, I don't understand
how calling <br>
is really changing the environment of <br>
in the <b>QueueBridge </b>subclass.<br>
For example, for the <b>QueueBridge </b>subclass, <b>createProducer </b>is
using the member <b>producerConnection</b>:<br>
<tt>&nbsp;&nbsp;&nbsp; protected MessageProducer createProducer() throws
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; producer = producerSession.createSender(null);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return producer;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; </tt><br>
but I think that this is not related anymore with the JmsQueueConnector
outboundQueueConnection, that is the only affected member in
jmsConnector.restartProducerConnection(). I don't ever know how or who,
in the initialization is setting up the QueueBridge producerConnection
member, calling, I suppose, setProducerConnection. <br>
I think that a solution to this should be to be able to change the
producerConnection of QueueBridge when we are restarting the Producer.
But for that, we should need to implement&nbsp; restartProducer in the
DestinationBridge subclasses.<br>
Any hint or idea? I really need to have remote bridge reconnections
working urgently, so please, if you need further info, make me know.<br>

View raw message