qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: How to use lifetime policies
Date Fri, 10 Jan 2014 00:16:33 GMT
Hi  Davin,

On 9 January 2014 19:46, Shearer, Davin <dshearer@novetta.com> wrote:

> Hello,
>
> Is there a way, using proton and QMF to create a queue that has a lifetime
> policy other than permanent?  If so, how?
>
>
I'm not aware if/how you can set the lifetime policies using Proton,
hopefully someone who is can chime in. To assist them, could you indicate
which part of Proton-c you are using specifically, e.g. Messenger or the
underlying Engine.

The Java broker doesn't support QMF by default though Fraser Adams did
write a plugin for it to add a level of support for it via the AMQP 0-10
clients and tools to go along with the GUI he put together for the C++
broker originally, but I'm not sure if that helps here as I have little
experience with it.


> I am trying to build a transport library in C using proton with support for
> a qpid broker.  What I need to do is create a reply queue.  The AMQP 1.0
> spec covers creating Dynamic Reply-To.  The problem I'm having is in
> garbage collection of the abandoned queues as these queues have a permanent
> lifetime policy.  If I were using qpid (rather than proton) I could simply
> have the client create the queue using a name of its choice with the
> DeleteOnClose lifetime policy and I also set exclusive to true and I get
> exactly what I need, but it this ties me to qpid.
>
> Instead, what I want to do is use proton for the AMQP 1.0 messaging and for
> queue management use the vendor-specific management framework (so for qpid,
> it is QMF).  This means that if I need to support other vendor's broker, I
> extend the queue management functions with support for that vendor's
> specific management framework and the actual messaging (since its AMQP 1.0)
> just uses proton.
>
> My thought is to use the qpid java broker's REST interface for queue
> creation.  It seems that I can create queues with the DeleteOn* lifetime
> policies using REST, but then the queues are immediately deleted.
>
>
Just to clear up some possible confusion at this point, the Lifetime Policy
reported via the Java broker REST interface doesn't reflect the AMQP 1.0
node LifetimePolicies (not yet at least). The value is currently able to be
either PERMANENT (the default) or AUTO_DELETE (hailing from AMQP 0-x).

>From a squint at the code, I think it probably displays the incorrect value
for a dynamically created queue created on a 1.0 connection as a result,
always indicating it is permanent when it may not be (because it doesnt get
marked as autodelete, and is instead removed via a different mechanism
based on the lifetime policy).

Also, from the same quick squint at the code, the broker only appears to
currently supports the Delete On Close policy (which is also what it uses
if none is specified).


> bash$ for policy in DeleteOnClose DeleteOnNoLinks DeleteOnNoLinksOfMessages
> DeleteOMessages; do echo "Policy: $policy"; curl -X PUT -u
> webadmin:webadmin -d "{\"durable\":true,\"lifetimePolicy\":\"${policy}\"}"
> http://localhost:8080/rest/queue/default/test_queue; curl -X GET -u
> webadmin:webadmin http://localhost:8080/rest/queue/default/test_queue;
> echo; done
> Policy: DeleteOnClose
> [ ]
> Policy: DeleteOnNoLinks
> [ ]
> Policy: DeleteOnNoLinksOfMessages
> [ ]
> Policy: DeleteOMessages
> [ ]
>
>
Continuing from the previous comments, the REST interface doenst support
specifying lifetimePolicy with values like that, not yet at least. It
appears you can specify AUTO_DELETE when creating the queue through REST
although I must admit I have never tried that, and definitely don't know
how it would react with a 1.0 consumer since the effect it would have is
different than that performed by the lifetime policy normally.

Also if I just create the queue, then try to change attributes later, the
> changes are ignored:
>
> curl PUT -u webadmin:webadmin -d '{}'
> http://localhost:8080/rest/queue/default/test_queue
> curl -X GET -u webadmin:webadmin
> http://localhost:8080/rest/queue/default/test_queue
> [ {
>   "id" : "f280eb22-8110-3d2b-91d3-f68192c8d1b7",
>   "name" : "test_queue",
>   "state" : "ACTIVE",
>   "durable" : false,
>   "lifetimePolicy" : "PERMANENT",
>   "type" : "standard",
>   "exclusive" : false,
>   "maximumDeliveryAttempts" : 0,
>   "queueFlowControlSizeBytes" : 0,
>   "queueFlowResumeSizeBytes" : 0,
>   "queueFlowStopped" : false,
>   "alertThresholdMessageAge" : 0,
>   "alertThresholdMessageSize" : 0,
>   "alertThresholdQueueDepthBytes" : 0,
>   "alertThresholdQueueDepthMessages" : 0,
>   "alertRepeatGap" : 30000,
>   "statistics" : {
>     "unacknowledgedBytes" : 0,
>     "bindingCount" : 0,
>     "queueDepthBytes" : 0,
>     "queueDepthMessages" : 0,
>     "totalEnqueuedBytes" : 0,
>     "persistentDequeuedBytes" : 0,
>     "consumerCount" : 0,
>     "unacknowledgedMessages" : 0,
>     "consumerCountWithCredit" : 0,
>     "totalDequeuedBytes" : 0,
>     "totalDequeuedMessages" : 0,
>     "totalEnqueuedMessages" : 0,
>     "persistentEnqueuedMessages" : 0,
>     "persistentEnqueuedBytes" : 0,
>     "persistentDequeuedMessages" : 0
>   }
> } ]
> curl -X PUT -u webadmin:webadmin -d '{"durable":true}'
> http://localhost:8080/t/queue/default/test_queue
> curl -X GET -u webadmin:webadmin
> http://localhost:8080/rest/queue/default/test_queue
>
> shows no change in the durable attribute.
>

Only some of the attributes can be modified on an existing queue, durable
isnt one of them currently:
  maximumDeliveryAttempts
  queueFlowControlSizeBytes
  queueFlowResumeSizeBytes
  queueFlowStopped
  alertThresholdMessageAge
  alertThresholdMessageSize
  alertThresholdQueueDepthBytes
  alertThresholdQueueDepthMessages
  alertRepeatGap
  alerternateExchange
  exclusive


>
> I am using qpid-broker-0.24 and proton 0.5.
>
> Thanks.
>

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