Adam,

To determine where the issue is, you could also use qpid-tool

then do a

list
show queue

look for the queue ID

show 'queue ID'

and see what is on the queue after the cancel to the local queue. That will tell us if the client
lib is holding onto them, or the new subscription is not getting started.

Carl.


Jonathan Robie wrote:
I find this surprising. When Adam does the cancel, I would expect all messages that haven't been acknowledged to be available on the server-side queue. When he subscribes the listener, I would expect him to receive the rest.

In my programs I always set up the subscriptions first, then call start(), but I don't see anything that looks wrong here.

I will get your program running on my box and let you know what I find.

Jonathan

Carl Trieloff wrote:

Sorry, one more question, are you M4 or trunk, as Gordon had corrected something in
this area a little while after M4.

Still thinking but the cancel after the start. might need another start(?). I work more on the broker
so will need to go look at that code.

Carl.


Adam Chase wrote:
That is correct.

I published 100 messages to the queue, got one off the localQueue and
then cancelled.  Since I didn't accept the one I would expect to get
100 from the listener.  But I'm getting none.  I think the LocalQueue
must have prefetched them and be holding on to them.  I thought maybe
the cancel would release them, but maybe I have to kill the session or
something.  Not totally sure.

Thanks,

Adam

On Wed, Jan 28, 2009 at 9:07 AM, Carl Trieloff <[email protected]> wrote:
Adam Chase wrote:
     SubscriptionManager subscriptions(session);
     // Create a listener and subscribe it to the queue named
"message_queue"
     Listener listener(subscriptions);
     // Receive messages until the subscription is cancelled
     // by Listener::received()
     LocalQueue lq;
     subscriptions.start();
     subscriptions.setAutoStop(false);
     SubscriptionSettings settings;
     settings.completionMode = COMPLETE_ON_ACCEPT;
     settings.acceptMode = ACCEPT_MODE_EXPLICIT;
     settings.autoAck = 0;
     settings.flowControl = FlowControl::unlimited();

     Subscription sub1 = subscriptions.subscribe(lq, "message_queue",
settings, "lq");
     Message m = lq.pop();
     sub1.cancel();
     sleep(5);

     subscriptions.subscribe(listener, "message_queue", "listener");
     subscriptions.wait();


When I do this I get no messages on my listener and subscriptions just
exits.  If I do a while(sleep) instead of the wait, I still never see
my message.  Even if I make 2 connections and 2 sessions and 2
subscriptionManagers and run them both I still don't see messages on
the listener.

Am I doing something wrong?


one brief clarification, you are not getting any messages when you
re-subscribe. I.e you
get messages on the lq, but not on the listener?

Carl.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to