autodelete and ack's

15 views
Skip to first unread message

Phillip Neumann

unread,
Mar 21, 2010, 9:23:10 PM3/21/10
to amq...@googlegroups.com
Hello all!

Im playing with amqp-js, and wondering about two things.

Is there a way to specify a queue and its binding to an exchange to be
autodeleted?
Maybe its a good idea to make it so, when using MQ.queue("auto")

How do i ack messages? queues seem to be created so that you need to
send an ack.
How do you send an ack?
How do you mark the queue with ack=false, so they dont need to be sent?

I can see with rabbitmqctl list_queues queue's messages grow, and they
dont autodelete themself.

Thanks!

dan.simpson

unread,
Mar 22, 2010, 11:31:59 AM3/22/10
to amqp-js
To enable auto deletion of the queue, just use the "autoDelete" option
when declaring the queue.

MQ.("auto", { autoDelete: true });

Other options: passive, durable, exclusive, nowait.

In regards to message acking, the current high level aspect of the
client does not leverage acking of messages. See line 144 here:
http://github.com/dansimpson/amqp-js/blob/master/actionscript/org/ds/velveteen/Queue.as

Setting false there and then implementing a means to send a BasicAck
message on recieve would fix your concerns. How to implement so that
the default behavior remains the same is a configuration problem.

http://github.com/dansimpson/amqp-js/blob/master/actionscript/org/ds/amqp/protocol/basic/BasicAck.as

If you make some changes to the Queue class (high level) you can
modify the options handler, the onQueueDeclare method, and the
onReceive method to accomplish your goal of acking messages with a
configuration option such as:

MQ.queue("auto", { ack: true });

amqp-js makes some assumptions to ease the implementation of what is
essentially pubsub. Many of the advanced features are possible via
the swf, but there are no public API's defined. My hope is the
community enables the functionality they desire and send me a pull
request.

--Dan

Dan Simpson

unread,
Mar 22, 2010, 11:46:07 AM3/22/10
to amqp-js
Oops,

I mean:  MQ.queue("auto", { autoDelete: true });

I suppose I should fully wake up before I write things on the internet. :)

--Dan

--
You received this message because you are subscribed to the Google Groups "amqp-js" group.
To post to this group, send email to amq...@googlegroups.com.
To unsubscribe from this group, send email to amqp-js+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/amqp-js?hl=en.


Phillip Neumann

unread,
Mar 22, 2010, 6:56:09 PM3/22/10
to amq...@googlegroups.com
Thanks for you reply Dan

Works great!

Reply all
Reply to author
Forward
0 new messages