activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Teira <mte...@tid.es>
Subject Re: Connection lost in JMS to JMS Bridge scenario.
Date Fri, 25 Aug 2006 10:02:01 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
James Strachan escribi&oacute;:
<blockquote
 cite="midec6e67fd0608250225o38db0127y1f41df1120682b3@mail.gmail.com"
 type="cite">On 8/25/06, Manuel Teira <a class="moz-txt-link-rfc2396E" href="mailto:mteira@tid.es">&lt;mteira@tid.es&gt;</a>
wrote:
  <br>
  <blockquote type="cite">James Strachan escribi&oacute;:
    <br>
&gt; So a few things going on here.
    <br>
&gt;
    <br>
&gt; * on a restart not all queues appear in JMX until they are
actually
    <br>
&gt; used. This page describes why along with explaining how to work
around
    <br>
&gt; this
    <br>
&gt;
<a class="moz-txt-link-freetext" href="http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html">http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html</a>
    <br>
&gt;
    <br>
Anyway, it seems that if there are messages in the database for the
    <br>
SUNRECV queue, it is created by ActiveMQ on restart. With the cases:
    <br>
1.-The messages are sent to the bridged broker.
    <br>
2.-The messages are not sent to the bridged broker, and on a new
message
    <br>
arriving, older are dropped.
    <br>
    <br>
I find (2) to be a problem.
    <br>
  </blockquote>
  <br>
I don't understand what (2) means. Could you try explain that again
please?
  <br>
</blockquote>
I apologize for my confusing explanation. This is the sequence of facts:<br>
<br>
1.- SunMQ is down. I send 5 messages to the SUNRECV queue that get
stored in the database.<br>
2.- Stop ActiveMQ. The database shows 5 messages for the container
'<a class="moz-txt-link-freetext" href="queue://SUNRECV">queue://SUNRECV</a>'.<br>
3.- SunMQ is started. After this, ActiveMQ is started too. Now, two
things can happen:<br>
<br>
&nbsp; a.-ActiveMQ delivers the 5 messages stored in the DB to the SunMQ
broker. This is OK, the desired situation.<br>
&nbsp;<br>
&nbsp; b.-ActiveMQ don't deliver the messages to the SunMQ broker. What we
find here is:<br>
&nbsp;&nbsp;&nbsp;&nbsp; -The JMX console is showing the SUNRECV queue, with:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QueueSize: 5.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EnqueueCount: 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DequeueCount: 5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;--Strange, as if the messages
where sent?<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConsumerCount: 1.<br>
&nbsp;&nbsp;&nbsp;&nbsp; The DB is showing 5 messages for the SUNRECV queue.<br>
&nbsp;&nbsp;&nbsp; SunMQ is not receiving these messages.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; Restarting ActiveMQ when we reach this situation, doesn't help.
For
two times, the data showed by the JMX console and the number of
messages stored in the database, where the same. This set of messages
never got sent to SunMQ.<br>
<br>
&nbsp; If under this situation, I try to send a new message to this queue:<br>
&nbsp;&nbsp; -The message reaches SunMQ.<br>
&nbsp;&nbsp; -The 5 older messages have dissapeared.<br>
&nbsp;&nbsp; -The JMX console shows:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QueueSize: 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DequeueCount: 6<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EnqueueCount: 1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConsumerCount: 1<br>
&nbsp;&nbsp; The database has 0 messages for SUNRECV.<br>
<br>
I expect this less confusing. Situations (a) or (b) happens randomly, I
think.<br>
<br>
<br>
<blockquote
 cite="midec6e67fd0608250225o38db0127y1f41df1120682b3@mail.gmail.com"
 type="cite"><br>
  <br>
  <br>
  <blockquote type="cite">&gt; * the database is not always in sync
with the broker as we use a high
    <br>
&gt; performance journal; so the database is checkpointed periodically
and
    <br>
&gt; is usually a bit behind the broker. You can avoid this by
disabling
    <br>
&gt; the high performance journal (but its pretty slow to do that).
Here's
    <br>
&gt; an example config if you want
    <br>
&gt; <a class="moz-txt-link-freetext" href="http://incubator.apache.org/activemq/jdbc-master-slave.html">http://incubator.apache.org/activemq/jdbc-master-slave.html</a>
    <br>
    <br>
Well, I've found the reason for this. It's because messages sent with
    <br>
the JMX sendTextMessage operation are not persistent, and that's the
    <br>
reason they're not inserted in the database (I think).
    <br>
  </blockquote>
  <br>
I don't follow. Persistence is defined not by the type of the message
  <br>
but by the deliveryMode of the MessageProducer
  <br>
</blockquote>
I suppose so that the MessageProducer of whatever mechanism used by the
JMX console operation to send the message is configured in a way the
messages are not persistent. <br>
<br>
This is a log of error when the message comes from my external client (
persistent = true )<br>
<tt><br>
[ERROR][2006/08/25.11:30:56.058][ActiveMQ Session Task]failed to
forward message: ActiveMQBytesMessage {commandId = 5, responseRequired
= true, messageId = ID:trabucco-43872-1156498253884-1:0:1:1:1,
originalDestination = null, originalTransactionId = null, producerId =
ID:trabucco-43872-1156498253884-1:0:1:1, destination = <a class="moz-txt-link-freetext"
href="queue://SUNRECV">queue://SUNRECV</a>,
transactionId = null, expiration = 0, timestamp = 1156498255598,
arrival = 0, correlationId = null, replyTo = null, <b>persistent = true</b>,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content =
org.apache.activeio.packet.ByteSequence@430b6, marshalledProperties =
null, dataStructure = null, redeliveryCounter = 0, size = 529,
properties = null, readOnlyProperties = true, readOnlyBody = true}
ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = null
}([C4064]: Cannot perform operation, producer is closed.)</tt><br>
<br>
<br>
The same with a message generated with sendTextMessage operation of the
JMX console ( persistent = false ).<br>
<br>
<tt>[DEBUG][2006/08/25.11:31:51.583][RMI TCP
Connection(11)-10.95.89.20]Sending message: ActiveMQTextMessage
{commandId = 0, responseRequired = false, messageId =
ID:trabucco-43808-1156496710158-3:1:1:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:trabucco-43808-1156496710158-3:1:1:1, destination = <a class="moz-txt-link-freetext"
href="queue://SUNRECV">queue://SUNRECV</a>,
transactionId = null, expiration = 0, timestamp = 1156498311577,
arrival = 0, correlationId = null, replyTo = null, <b>persistent =
false</b>, type = null, priority = 0, groupID = null, groupSequence =
0, targetConsumerId = null, compressed = false, userID = null, content
= null, marshalledProperties = null, dataStructure = null,
redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties
= true, readOnlyBody = true, text = a}</tt><br>
<br>
<br>
<br>
<blockquote
 cite="midec6e67fd0608250225o38db0127y1f41df1120682b3@mail.gmail.com"
 type="cite"><br>
  <br>
  <blockquote type="cite">&gt; BTW I looked at the code for the JMS
bridge and if a connection is
    <br>
&gt; lost with the remote broker, the bridge just stops - so no
messages
    <br>
&gt; should be lost. Though it will require a bounce of the broker to
    <br>
&gt; reconnect.
    <br>
I'm going to open a JIRA for this.
    <br>
  </blockquote>
  <br>
Great
  <br>
  <br>
</blockquote>
<br>
</body>
</html>

Mime
View raw message