Re: msgs that should have been deleted after delivery stay until openjms restarted

Tim Anderson <[email protected]> Thu, 08 Jun 2006 23:45:16 +1000
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
--===============1195719484==
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!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="mids4855866.041-c6de4BIW62kxVUPhT0UPiqahU2mTh4Fe@public.gmane.org" 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:[email protected]">[email protected]</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>


--===============1195719484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1195719484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openjms-developer mailing list
openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/openjms-developer

--===============1195719484==--