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]

Reply via email to