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

Starting and stopping subscriptions #189

Open
aconanlai opened this issue Feb 26, 2019 · 2 comments
Open

Starting and stopping subscriptions #189

aconanlai opened this issue Feb 26, 2019 · 2 comments

Comments

@aconanlai
Copy link

aconanlai commented Feb 26, 2019

I have read through the docs, and i understand that In general, Rabbot works best when queues exist for the lifetime of a service. Starting and stopping queue subscriptions is likely to produce unexpected behaviors (read: avoid it). - however, my use case requires queues to be created dynamically and subscriptions to be created/remove dynamically - am I better off using amqplib? For example, a simple test case:

  1. I create a queue, bind it to the exchange, then call rabbot.startSubscription(queueName)
  2. Call rabbot.stopSubscription(queueName)
  3. Call rabbot.startSubscription(queueName)

The second startSubscription will never resolve, as it seems that the state is already subscribed? so the handlers in queueFsm.js never get called.

Is my approach incorrect?

@zlintz
Copy link

zlintz commented Feb 26, 2019

Can you provide more context around your use case of why you need to do that?

@aconanlai
Copy link
Author

aconanlai commented Feb 26, 2019

Can you provide more context around your use case of why you need to do that?

i have a horizontally scaled websocket server for clients to connect to. another service will send messages to a direct exchange, and these servers will have one queue for each user bound to the exchange. because these servers will be created/shutdown to meet changing load, and users can be shuffled between servers to rebalance them, i need to be able to start/stop subscriptions.

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