RabbitMQ: RabbitSubscribe using a handler name without corresponding handler config asserts randomized queues
ckfngod opened this issue · comments
Similar to #667
If I use RabbitSubscribe
with a handler name but do not provide a corresponding handler config to RabbitMQModule
then amq.gen-*
queues are asserted. For example:
Given handlers:
@RabbitSubscribe({ name: 'handlerA' })
handlerA() { ... }
@RabbitSubscribe({ name: 'handlerB' })
handlerB() { ... }
@RabbitSubscribe({ name: 'handlerC' })
handlerC() { ... }
With RabbitMQModule
config:
{
handlers: {
handlerA: [{ ... }],
handlerB: [],
},
...
}
Then a amq.gen-*
queue is asserted because of the missing handlerC
property in the config object. The empty array for handlerB
does not cause a amq.gen-*
queue to be asserted.
@ckfngod What's the expected outcome? Shall we have an explicit property config to prevent such randomness? I'm not sure regarding the follow up item here but i welcome proposals
@underfisk I expected it to not assert a queue if no config is provided for a handler name regardless of how that happens. It just seems kind of strange that an explicit empty config array behaves differently than a missing property key when they both mean config is missing.