qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Trieloff <cctriel...@redhat.com>
Subject Re: Subscribe cancel release question cpp broker
Date Wed, 28 Jan 2009 17:39:32 GMT

yes, there are no dequeues, so the broker has all the messages which is 
correct. So
it looks like the second subscriptions is not running - will look into that

Carl.


Adam Chase wrote:
> I used the qpid-tool and see this for my queue ( I guess I was only
> writing 10 messages in my producer):
>
>    Type       Element                110
>    =================================================
>    property   vhostRef               103
>    property   name                   message_queue
>    property   durable                False
>    property   autoDelete             False
>    property   exclusive              False
>    property   arguments              {}
>    statistic  msgTotalEnqueues       11 messages
>    statistic  msgTotalDequeues       0
>    statistic  msgTxnEnqueues         0
>    statistic  msgTxnDequeues         0
>    statistic  msgPersistEnqueues     0
>    statistic  msgPersistDequeues     0
>    statistic  msgDepth               11
>    statistic  byteDepth              108 octets
>    statistic  byteTotalEnqueues      108
>    statistic  byteTotalDequeues      0
>    statistic  byteTxnEnqueues        0
>    statistic  byteTxnDequeues        0
>    statistic  bytePersistEnqueues    0
>    statistic  bytePersistDequeues    0
>    statistic  consumerCount          1 consumer
>    statistic  consumerCountHigh      1
>    statistic  consumerCountLow       1
>    statistic  bindingCount           2 bindings
>    statistic  bindingCountHigh       2
>    statistic  bindingCountLow        2
>    statistic  unackedMessages        0 messages
>    statistic  unackedMessagesHigh    0
>    statistic  unackedMessagesLow     0
>    statistic  messageLatencySamples  0
>    statistic  messageLatencyMin      0
>    statistic  messageLatencyMax      0
>    statistic  messageLatencyAverage  0
>
> Does this help?
>
> Adam
>
> On Wed, Jan 28, 2009 at 9:53 AM, Adam Chase <adam.chase1@gmail.com> wrote:
>   
>> I am using M4.
>>
>> Adam
>>
>> On Wed, Jan 28, 2009 at 9:49 AM, Jonathan Robie
>> <jonathan.robie@redhat.com> 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 <cctrieloff@redhat.com>
>>>>> 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:users-subscribe@qpid.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>> ---------------------------------------------------------------------
>>>> Apache Qpid - AMQP Messaging Implementation
>>>> Project:      http://qpid.apache.org
>>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>>
>>>>         
>>>       
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>   


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message