Open aconanlai opened 5 years ago
Can you provide more context around your use case of why you need to do that?
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.
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 usingamqplib
? For example, a simple test case:rabbot.startSubscription(queueName)
rabbot.stopSubscription(queueName)
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?