qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shearer, Davin" <dshea...@novetta.com>
Subject How to use lifetime policies
Date Thu, 09 Jan 2014 19:46:39 GMT
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 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.

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
[ ]

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.

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

Thanks.

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