ListenerOptions interface
Signature:
export interface ListenerOptions
Properties
Property | Type | Description |
---|---|---|
buffer? | boolean | (Optional) Sets whether or not the listener should buffer incoming messages should it go offline. This (true ) is the default behaviour.If buffer is set to false , the listener will behave more like a regular pub/sub communication method; it will only receive messages while it's listening, and will miss all messages that are sent while it's not.This can be useful if you wish to temporarily tap in to an emission or for high-load, non-critical listeners. |
lazy? | boolean | (Optional) Sets whether or not the listener will lazily connect to RabbitMQ. If set to true , the listener will require that open() is run in order to start receiving events. Otherwise the listener will automatically connect.Either way, open() can still be used to retrieve a promise that resolves when the listener is ready and waiting.Defaults to false . |
prefetch? | number | (Optional) Sets how many messages the endpoint will pull off of the queue to process locally. Setting this to 0 disables prefetch and consumers will pull an unlimited number of items from the queue.Unlimited prefetch should be used with care. Endpoints can pull messages faster than they can deal with them, resulting in rapid memory consumption growth.Values in the 100 through 300 range usually offer optimal throughput and do not run significant risk of overwhelming consumers. Higher values often run in to the law of diminishing returns.Defaults to 48. |