Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set TTL/x-expires on queue #27

Open
KodeZ opened this issue Mar 6, 2015 · 3 comments
Open

Set TTL/x-expires on queue #27

KodeZ opened this issue Mar 6, 2015 · 3 comments

Comments

@KodeZ
Copy link

KodeZ commented Mar 6, 2015

I cannot see a way to set the TTL on a queue. I would like the queue to die after a period if noone reads from it anymore. Is there a known way to set this? I see that auto-delete is an option. Could one be added for x-expires too?

Ref: bottom of: https://www.rabbitmq.com/ttl.html

@paolo-losi
Copy link
Owner

At the moment x-expires is not supported but it should be really straight forward to add support for it

if you look at the implementation of queue_declare you'll see that there is the "arguments" param
to _queue.Declare. that is where x-expires should be set:

arguments={'x-expires': ...}

The thing to do is to expose the arguments param to queue_declare.
Have you got a chance to test it out and prepare a pull request?
I can help you out ...

@KodeZ
Copy link
Author

KodeZ commented Mar 6, 2015

Yes, I saw that, but then I also found a link to a forked version that does that, and adds a whole lot of comments too. Check this:
master...sjlongland:master
Is not that what needs to be done?

@KodeZ
Copy link
Author

KodeZ commented Mar 7, 2015

I have been testing the forked repository, and I am getting some issues with setting x-expires. It should have an integer parameter, but it does noe accept one. If I do send and integer, it fails on .encode, so I just did a hack, and said str(s).encode, but that gives the problem of the parameter being a string again. Any easy fix that you can think of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants