Discussion:
[openjms-developer] msgs that should have been deleted after delivery stay until openjms restarted
Jim Marshall
2006-06-06 17:26:32 UTC
Permalink
Hi Tim. I have reproduced this on three different systems, with some
tests using localhost and others using openjms remotely. This problem
occurs every time on every system if the following steps are performed.
I probably wasn't too clear in my first email about this. So, here's
what I do...

- Start openjms and add some msgs to a queue.
- Stop openjms
- Start client that loops a few times while trying to connect to
openjms, then pause execution after a couple of failed attempts to
connect to openjms. I've done this pause both in the debugger and just
while the program waits on it's own.
- Start openjms
- Continue executing client if in debugger, or client will continue on
own if running. The messages will be delivered as expected at this time.
- Client stops after no more messages in queue.
- Restart client. No messages are delivered, but admin api says there
are msgs in the queue. Code says no msgs available so client stops.
- Look into queue using either admin api or admin.bat. Both say all
original messages are still in the queue.
- Turn openjms off and restart. Both admin api and admin.bat say there
are no msgs in the queue.

It all works normally if openjms is running before the client is
started, and I read just a couple of the messages then stop the client,
then restart openjms. Then unread messages are still there in the queue
and the read msgs are gone, so I don't believe it has to do with
restarting openjms or msg expiration. I'm using just a basic
configuration here...regular queues, no expiration, no filtering,
regular text msgs, just simple like the examples. I've included the
contents of my openjms config file below, in case that helps.

Please let me know if there are other details I can provide that might
help with this.

Thanks.
Jim

<?xml version="1.0"?>

<Configuration>

<!-- Optional. This represents the default configuration -->
<ServerConfiguration host="localhost" embeddedJNDI="true" />

<Connectors>
<Connector scheme="tcp">
<ConnectionFactories>
<ConnectionFactory name="ConnectionFactory" />
</ConnectionFactories>
</Connector>
</Connectors>

<!-- Required -->
<DatabaseConfiguration>
<RdbmsDatabaseConfiguration
driver="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:openjmsdb;create=true"
user="openjms"
password="openjms"/>
</DatabaseConfiguration>

<!-- Required -->
<AdminConfiguration script="${openjms.home}\bin\startup.bat" />

<!-- Optional. If not specified, no destinations will be created -->
<AdministeredDestinations>
<AdministeredQueue name="TO_CUST" />
<AdministeredQueue name="FROM_CUST" />
</AdministeredDestinations>

<!-- Optional. If not specified, no users will be created -->
<Users>
<User name="admin" password="openjms" />
</Users>

</Configuration>
Actually, I take it back. I can't reproduce.
Are your messages are set to expire? If so, and the messages expire
before
they are consumed, references to them will remain until either:
1. the consumer tries to consume them
2. the server is restarted
The admin interface will also report messages being present.

-Tim
Yep it's a bug. Not immediately clear why. I'll have a look next week.
-Tim
From: Jim Marshall
Hi. I've got a bit of an unusual problem.
Because it takes a few seconds for openjms to start up, my client
code checks for the existence of the openjms server by just trying to
create a connection. When that fails, the client will wait for a
little while to give openjms a chance to start up and then tries
again. This case will almost never happen, but I thought I'd add it
anyway.
My problem is that if the client fails to connect because openjms is
not running, then it waits and I start openjms, then the client
connects again successfully, I receive the messages (using
.receive(1) and AUTO_ACK), but they do not get deleted from the
queue. If I try to read them again by restarting the client they are
not delivered. But, the admin interface says the messages are still
there. Once I shut down and restart openjms, the messages are gone.
I'm not sure what's happening here.
I'm not sure if this matters but I'm using openjms as the jndi
provider, and the client is intercepting the jndi naming exception
that occurs when I do the context lookup in order to know when to
wait for openjms to start up.
I'm using OpenJMS version 0.7.7-alpha-3 with all the default configs,
and the tcp connector. Everything is running on my local machine.
Thanks for any help.
Jim
_______________________________________________
openjms-developer mailing list
openjms-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openjms-developer


CONFIDENTIALITY NOTICE: This communication with its contents may contain
confidential and/or legally privileged information. It is solely for the
use of the intended recipient(s). Unauthorized interception, review, use
or disclosure is prohibited and may violate applicable laws including
the Electronic Communications Privacy Act. If you are not the intended
recipient, please contact the sender and destroy all copies of the
communication.
Tim Anderson
2006-06-08 13:45:16 UTC
Permalink
<!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">
Thanks for that. I can now reproduce.<br>
Raised as
<a class="moz-txt-link-freetext" href="http://sourceforge.net/tracker/index.php?func=detail&aid=1502902&group_id=54559&atid=474136">http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1502902&amp;group_id=54559&amp;atid=474136</a><br>
<br>
Regards,<br>
<br>
Tim<br>
<br>
Jim Marshall wrote:
<blockquote cite="***@sahdcgwia2.caldoj.net" type="cite">
<pre wrap="">Hi Tim. I have reproduced this on three different systems, with some
tests using localhost and others using openjms remotely. This problem
occurs every time on every system if the following steps are performed.
I probably wasn't too clear in my first email about this. So, here's
what I do...

- Start openjms and add some msgs to a queue.
- Stop openjms
- Start client that loops a few times while trying to connect to
openjms, then pause execution after a couple of failed attempts to
connect to openjms. I've done this pause both in the debugger and just
while the program waits on it's own.
- Start openjms
- Continue executing client if in debugger, or client will continue on
own if running. The messages will be delivered as expected at this time.
- Client stops after no more messages in queue.
- Restart client. No messages are delivered, but admin api says there
are msgs in the queue. Code says no msgs available so client stops.
- Look into queue using either admin api or admin.bat. Both say all
original messages are still in the queue.
- Turn openjms off and restart. Both admin api and admin.bat say there
are no msgs in the queue.

It all works normally if openjms is running before the client is
started, and I read just a couple of the messages then stop the client,
then restart openjms. Then unread messages are still there in the queue
and the read msgs are gone, so I don't believe it has to do with
restarting openjms or msg expiration. I'm using just a basic
configuration here...regular queues, no expiration, no filtering,
regular text msgs, just simple like the examples. I've included the
contents of my openjms config file below, in case that helps.

Please let me know if there are other details I can provide that might
help with this.

Thanks.
Jim

&lt;?xml version="1.0"?&gt;

&lt;Configuration&gt;

&lt;!-- Optional. This represents the default configuration --&gt;
&lt;ServerConfiguration host="localhost" embeddedJNDI="true" /&gt;

&lt;Connectors&gt;
&lt;Connector scheme="tcp"&gt;
&lt;ConnectionFactories&gt;
&lt;ConnectionFactory name="ConnectionFactory" /&gt;
&lt;/ConnectionFactories&gt;
&lt;/Connector&gt;
&lt;/Connectors&gt;

&lt;!-- Required --&gt;
&lt;DatabaseConfiguration&gt;
&lt;RdbmsDatabaseConfiguration
driver="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:openjmsdb;create=true"
user="openjms"
password="openjms"/&gt;
&lt;/DatabaseConfiguration&gt;

&lt;!-- Required --&gt;
&lt;AdminConfiguration script="${openjms.home}\bin\startup.bat" /&gt;

&lt;!-- Optional. If not specified, no destinations will be created --&gt;
&lt;AdministeredDestinations&gt;
&lt;AdministeredQueue name="TO_CUST" /&gt;
&lt;AdministeredQueue name="FROM_CUST" /&gt;
&lt;/AdministeredDestinations&gt;

&lt;!-- Optional. If not specified, no users will be created --&gt;
&lt;Users&gt;
&lt;User name="admin" password="openjms" /&gt;
&lt;/Users&gt;

&lt;/Configuration&gt; </pre> <blockquote type="cite"> <blockquote type="cite"> <blockquote type="cite"> <pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:***@netspace.net.au">***@netspace.net.au</a> 06/06/06 6:12 AM &gt;&gt;&gt;
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->Actually, I take it back. I can't reproduce.
Are your messages are set to expire? If so, and the messages expire
before
they are consumed, references to them will remain until either:
1. the consumer tries to consume them
2. the server is restarted
The admin interface will also report messages being present.

-Tim

</pre>
<blockquote type="cite">
<pre wrap="">Yep it's a bug. Not immediately clear why. I'll have a look next week.

-Tim
</pre>
<blockquote type="cite">
<pre wrap="">From: Jim Marshall

Hi. I've got a bit of an unusual problem.

Because it takes a few seconds for openjms to start up, my client
code checks for the existence of the openjms server by just trying to
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">create a connection. When that fails, the client will wait for a
little while to give openjms a chance to start up and then tries
again. This case will almost never happen, but I thought I'd add it
anyway.
My problem is that if the client fails to connect because openjms is
not running, then it waits and I start openjms, then the client
connects again successfully, I receive the messages (using
.receive(1) and AUTO_ACK), but they do not get deleted from the
queue. If I try to read them again by restarting the client they are
not delivered. But, the admin interface says the messages are still
there. Once I shut down and restart openjms, the messages are gone.
I'm not sure what's happening here.

I'm not sure if this matters but I'm using openjms as the jndi
provider, and the client is intercepting the jndi naming exception
that occurs when I do the context lookup in order to know when to
wait for openjms to start up.

I'm using OpenJMS version 0.7.7-alpha-3 with all the default configs,
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">and the tcp connector. Everything is running on my local machine.
Thanks for any help.

Jim
</pre>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

Loading...