From 3baaee6649c7bde47ce4c22c12ca4dc367ab301d Mon Sep 17 00:00:00 2001 From: Weyoss Date: Sun, 24 Mar 2024 11:30:59 +0100 Subject: [PATCH] docs: update documentation and API reference --- docs/README.md | 1 + docs/api/README.md | 286 +++++++++++------- docs/api/classes/Consumer.md | 192 +++++++++--- docs/api/classes/ConsumerError.md | 126 +++++++- docs/api/classes/ConsumerGroupDeleteError.md | 124 ++++++++ .../classes/ConsumerGroupIdNotFoundError.md | 124 ++++++++ .../ConsumerGroupIdNotSupportedError.md | 124 ++++++++ .../classes/ConsumerGroupIdRequiredError.md | 124 ++++++++ docs/api/classes/ConsumerGroups.md | 17 ++ .../classes/ConsumerInvalidGroupIdError.md | 124 ++++++++ ...onsumerMessageHandlerAlreadyExistsError.md | 124 ++++++++ .../classes/ConsumerMessageHandlerError.md | 37 --- .../ConsumerMessageHandlerFileError.md | 29 -- ...merMessageHandlerFilenameExtensionError.md | 29 -- .../ConsumerMessageHandlerWorkerError.md | 35 --- docs/api/classes/EventBusRedisInstance.md | 235 ++++++++++++++ docs/api/classes/ExchangeDirect.md | 102 +------ docs/api/classes/ExchangeError.md | 124 ++++++++ docs/api/classes/ExchangeFanOut.md | 140 +++------ docs/api/classes/ExchangeFanOutError.md | 124 ++++++++ docs/api/classes/ExchangeInvalidDataError.md | 124 ++++++++ docs/api/classes/ExchangeTopic.md | 102 +------ docs/api/classes/Message.md | 17 ++ docs/api/classes/MessageDeleteError.md | 124 ++++++++ .../MessageDestinationQueueAlreadySetError.md | 124 ++++++++ .../MessageDestinationQueueRequiredError.md | 124 ++++++++ docs/api/classes/MessageError.md | 124 ++++++++ .../classes/MessageExchangeRequiredError.md | 124 ++++++++ docs/api/classes/MessageNotFoundError.md | 124 ++++++++ docs/api/classes/MessageRequeueError.md | 159 ++++++++++ docs/api/classes/Namespace.md | 17 ++ docs/api/classes/NamespaceError.md | 161 ++++++++++ docs/api/classes/NamespaceNotFoundError.md | 159 ++++++++++ docs/api/classes/Producer.md | 176 +++++++++-- docs/api/classes/ProducerError.md | 124 ++++++++ .../ProducerInstanceNotRunningError.md | 124 ++++++++ .../ProducerMessageExchangeRequiredError.md | 124 ++++++++ .../ProducerMessageNotPublishedError.md | 124 ++++++++ .../ProducerMessageNotScheduledError.md | 124 ++++++++ ...ProducerQueueWithoutConsumerGroupsError.md | 124 ++++++++ docs/api/classes/ProducibleMessage.md | 31 +- docs/api/classes/Queue.md | 17 ++ docs/api/classes/QueueAcknowledgedMessages.md | 21 ++ docs/api/classes/QueueDeadLetteredMessages.md | 21 ++ docs/api/classes/QueueError.md | 130 +++++++- docs/api/classes/QueueExistsError.md | 124 ++++++++ .../classes/QueueHasRunningConsumersError.md | 124 ++++++++ docs/api/classes/QueueMessageError.md | 161 ++++++++++ docs/api/classes/QueueMessageRequeueError.md | 35 --- docs/api/classes/QueueMessages.md | 23 +- .../classes/QueueNamespaceNotFoundError.md | 35 --- docs/api/classes/QueueNotEmptyError.md | 124 ++++++++ docs/api/classes/QueueNotFoundError.md | 124 ++++++++ docs/api/classes/QueuePendingMessages.md | 17 ++ docs/api/classes/QueueRateLimit.md | 19 +- docs/api/classes/QueueRateLimitError.md | 128 +++++++- docs/api/classes/QueueScheduledMessages.md | 21 ++ .../enums/EWorkerThreadMessageCodeConsume.md | 29 -- .../api/enums/EWorkerThreadMessageCodeExit.md | 43 --- docs/api/interfaces/IConsumerConfig.md | 15 + docs/api/interfaces/IEventBusConfig.md | 15 + docs/api/interfaces/IEventListener.md | 48 --- docs/api/interfaces/IExchange.md | 76 +---- docs/api/interfaces/IExchangeSerialized.md | 42 --- docs/api/interfaces/IMessageParams.md | 2 +- docs/api/interfaces/IMessageTransferable.md | 2 +- docs/api/interfaces/IRedisSMQConfig.md | 6 +- .../api/interfaces/IRedisSMQConfigRequired.md | 21 +- docs/api/interfaces/ITopicParams.md | 22 ++ docs/configuration.md | 65 ++-- docs/consuming-messages.md | 8 +- docs/esm-cjs-modules.md | 10 +- docs/event-bus.md | 66 ++++ docs/event-listeners.md | 77 ----- docs/exchanges-and-delivery-models.md | 2 +- docs/message-exchanges.md | 74 ++--- docs/message-handler-worker-threads.md | 11 +- docs/messages.md | 4 +- docs/multiplexing.md | 18 +- docs/performance.md | 4 +- docs/producing-messages.md | 36 +-- docs/queue-delivery-models.md | 66 ++-- docs/queue-rate-limiting.md | 12 +- docs/queues.md | 45 ++- docs/scheduling-messages.md | 14 +- 85 files changed, 5414 insertions(+), 1198 deletions(-) delete mode 100644 docs/api/classes/ConsumerMessageHandlerError.md delete mode 100644 docs/api/classes/ConsumerMessageHandlerFileError.md delete mode 100644 docs/api/classes/ConsumerMessageHandlerFilenameExtensionError.md delete mode 100644 docs/api/classes/ConsumerMessageHandlerWorkerError.md create mode 100644 docs/api/classes/EventBusRedisInstance.md create mode 100644 docs/api/classes/MessageRequeueError.md create mode 100644 docs/api/classes/NamespaceError.md create mode 100644 docs/api/classes/NamespaceNotFoundError.md create mode 100644 docs/api/classes/QueueMessageError.md delete mode 100644 docs/api/classes/QueueMessageRequeueError.md delete mode 100644 docs/api/classes/QueueNamespaceNotFoundError.md delete mode 100644 docs/api/enums/EWorkerThreadMessageCodeConsume.md delete mode 100644 docs/api/enums/EWorkerThreadMessageCodeExit.md create mode 100644 docs/api/interfaces/IConsumerConfig.md create mode 100644 docs/api/interfaces/IEventBusConfig.md delete mode 100644 docs/api/interfaces/IEventListener.md delete mode 100644 docs/api/interfaces/IExchangeSerialized.md create mode 100644 docs/api/interfaces/ITopicParams.md create mode 100644 docs/event-bus.md delete mode 100644 docs/event-listeners.md diff --git a/docs/README.md b/docs/README.md index 8d4bcb2d..2d50950d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,6 +19,7 @@ See [API Reference](api/README.md) for more details. - [Exchanges and Delivery Models](exchanges-and-delivery-models.md) - [Scheduling Messages](scheduling-messages.md) - [Message Handler Worker Threads](message-handler-worker-threads.md) +- [EventBus](event-bus.md) - [Multiplexing](multiplexing.md) - [Performance](performance.md) - [RedisSMQ Architecture](redis-smq-architecture.md) diff --git a/docs/api/README.md b/docs/api/README.md index 2a95149d..e4f98079 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -15,14 +15,13 @@ - [EQueueDeliveryModel](enums/EQueueDeliveryModel.md) - [EQueueProperty](enums/EQueueProperty.md) - [EQueueType](enums/EQueueType.md) -- [EWorkerThreadMessageCodeConsume](enums/EWorkerThreadMessageCodeConsume.md) -- [EWorkerThreadMessageCodeExit](enums/EWorkerThreadMessageCodeExit.md) ### Classes - [Configuration](classes/Configuration.md) - [Consumer](classes/Consumer.md) - [ConsumerGroups](classes/ConsumerGroups.md) +- [EventBusRedisInstance](classes/EventBusRedisInstance.md) - [ExchangeDirect](classes/ExchangeDirect.md) - [ExchangeFanOut](classes/ExchangeFanOut.md) - [ExchangeTopic](classes/ExchangeTopic.md) @@ -38,7 +37,7 @@ - [QueueRateLimit](classes/QueueRateLimit.md) - [QueueScheduledMessages](classes/QueueScheduledMessages.md) -### Errors +#### Errors - [ConsumerError](classes/ConsumerError.md) - [ConsumerGroupDeleteError](classes/ConsumerGroupDeleteError.md) @@ -47,10 +46,6 @@ - [ConsumerGroupIdRequiredError](classes/ConsumerGroupIdRequiredError.md) - [ConsumerInvalidGroupIdError](classes/ConsumerInvalidGroupIdError.md) - [ConsumerMessageHandlerAlreadyExistsError](classes/ConsumerMessageHandlerAlreadyExistsError.md) -- [ConsumerMessageHandlerError](classes/ConsumerMessageHandlerError.md) -- [ConsumerMessageHandlerFileError](classes/ConsumerMessageHandlerFileError.md) -- [ConsumerMessageHandlerFilenameExtensionError](classes/ConsumerMessageHandlerFilenameExtensionError.md) -- [ConsumerMessageHandlerWorkerError](classes/ConsumerMessageHandlerWorkerError.md) - [ExchangeError](classes/ExchangeError.md) - [ExchangeFanOutError](classes/ExchangeFanOutError.md) - [ExchangeInvalidDataError](classes/ExchangeInvalidDataError.md) @@ -60,6 +55,9 @@ - [MessageError](classes/MessageError.md) - [MessageExchangeRequiredError](classes/MessageExchangeRequiredError.md) - [MessageNotFoundError](classes/MessageNotFoundError.md) +- [MessageRequeueError](classes/MessageRequeueError.md) +- [NamespaceError](classes/NamespaceError.md) +- [NamespaceNotFoundError](classes/NamespaceNotFoundError.md) - [ProducerError](classes/ProducerError.md) - [ProducerInstanceNotRunningError](classes/ProducerInstanceNotRunningError.md) - [ProducerMessageExchangeRequiredError](classes/ProducerMessageExchangeRequiredError.md) @@ -69,20 +67,19 @@ - [QueueError](classes/QueueError.md) - [QueueExistsError](classes/QueueExistsError.md) - [QueueHasRunningConsumersError](classes/QueueHasRunningConsumersError.md) -- [QueueMessageRequeueError](classes/QueueMessageRequeueError.md) -- [QueueNamespaceNotFoundError](classes/QueueNamespaceNotFoundError.md) +- [QueueMessageError](classes/QueueMessageError.md) - [QueueNotEmptyError](classes/QueueNotEmptyError.md) - [QueueNotFoundError](classes/QueueNotFoundError.md) - [QueueRateLimitError](classes/QueueRateLimitError.md) ### Interfaces +- [IConsumerConfig](interfaces/IConsumerConfig.md) - [IConsumerHeartbeat](interfaces/IConsumerHeartbeat.md) - [IConsumerHeartbeatPayload](interfaces/IConsumerHeartbeatPayload.md) - [IConsumerMessageHandlerArgs](interfaces/IConsumerMessageHandlerArgs.md) -- [IEventListener](interfaces/IEventListener.md) +- [IEventBusConfig](interfaces/IEventBusConfig.md) - [IExchange](interfaces/IExchange.md) -- [IExchangeSerialized](interfaces/IExchangeSerialized.md) - [IMessageParams](interfaces/IMessageParams.md) - [IMessageStateTransferable](interfaces/IMessageStateTransferable.md) - [IMessageTransferable](interfaces/IMessageTransferable.md) @@ -103,33 +100,33 @@ - [IQueueRateLimit](interfaces/IQueueRateLimit.md) - [IRedisSMQConfig](interfaces/IRedisSMQConfig.md) - [IRedisSMQConfigRequired](interfaces/IRedisSMQConfigRequired.md) +- [ITopicParams](interfaces/ITopicParams.md) ### Type Aliases - [IQueueMessagesPageParams](README.md#iqueuemessagespageparams) +- [TConsumerConsumeMessageEvent](README.md#tconsumerconsumemessageevent) +- [TConsumerDequeueMessageEvent](README.md#tconsumerdequeuemessageevent) +- [TConsumerEvent](README.md#tconsumerevent) +- [TConsumerHeartbeatEvent](README.md#tconsumerheartbeatevent) - [TConsumerMessageHandler](README.md#tconsumermessagehandler) +- [TConsumerMessageHandlerEvent](README.md#tconsumermessagehandlerevent) - [TConsumerMessageHandlerFn](README.md#tconsumermessagehandlerfn) +- [TConsumerMessageHandlerRunnerEvent](README.md#tconsumermessagehandlerrunnerevent) - [TConsumerRedisKeys](README.md#tconsumerrediskeys) -- [TEventListenersConfig](README.md#teventlistenersconfig) -- [TExchange](README.md#texchange) -- [TExchangeDirectBindingParams](README.md#texchangedirectbindingparams) -- [TExchangeFanOutBindingParams](README.md#texchangefanoutbindingparams) -- [TExchangeSerialized](README.md#texchangeserialized) -- [TExchangeTopicBindingParams](README.md#texchangetopicbindingparams) +- [TEventBusEvent](README.md#teventbusevent) +- [TExchangeDirectTransferable](README.md#texchangedirecttransferable) +- [TExchangeFanOutTransferable](README.md#texchangefanouttransferable) +- [TExchangeTopicTransferable](README.md#texchangetopictransferable) +- [TExchangeTransferable](README.md#texchangetransferable) - [TMessageConsumeOptions](README.md#tmessageconsumeoptions) +- [TProducerEvent](README.md#tproducerevent) - [TQueueConsumer](README.md#tqueueconsumer) +- [TQueueEvent](README.md#tqueueevent) - [TQueueExtendedParams](README.md#tqueueextendedparams) - [TQueueMessagesPaginationParams](README.md#tqueuemessagespaginationparams) - [TQueueMessagesParams](README.md#tqueuemessagesparams) - [TRedisSMQEvent](README.md#tredissmqevent) -- [TTopicParams](README.md#ttopicparams) -- [TWorkerThreadError](README.md#tworkerthreaderror) -- [TWorkerThreadMessage](README.md#tworkerthreadmessage) -- [TWorkerThreadMessageCode](README.md#tworkerthreadmessagecode) - -### Functions - -- [disconnect](README.md#disconnect) ## Type Aliases @@ -148,216 +145,279 @@ ___ -### TConsumerMessageHandler +### TConsumerConsumeMessageEvent -Ƭ **TConsumerMessageHandler**: `string` \| [`TConsumerMessageHandlerFn`](README.md#tconsumermessagehandlerfn) +Ƭ **TConsumerConsumeMessageEvent**: `Object` -___ +#### Type declaration -### TConsumerMessageHandlerFn +| Name | Type | +| :------ | :------ | +| `consumer.consumeMessage.error` | (`err`: `Error`, `consumerId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md)) => `void` | +| `consumer.consumeMessage.messageAcknowledged` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` | +| `consumer.consumeMessage.messageDeadLettered` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `messageHandlerId`: `string`, `consumerId`: `string`, `cause`: [`EConsumeMessageDeadLetterCause`](enums/EConsumeMessageDeadLetterCause.md)) => `void` | +| `consumer.consumeMessage.messageDelayed` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` | +| `consumer.consumeMessage.messageRequeued` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` | +| `consumer.consumeMessage.messageUnacknowledged` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `messageHandlerId`: `string`, `consumerId`: `string`, `cause`: [`EConsumeMessageUnacknowledgedCause`](enums/EConsumeMessageUnacknowledgedCause.md)) => `void` | -Ƭ **TConsumerMessageHandlerFn**: (`msg`: [`IMessageTransferable`](interfaces/IMessageTransferable.md), `cb`: `ICallback`\<`void`\>) => `void` +___ -#### Type declaration +### TConsumerDequeueMessageEvent -▸ (`msg`, `cb`): `void` +Ƭ **TConsumerDequeueMessageEvent**: `Object` -##### Parameters +#### Type declaration | Name | Type | | :------ | :------ | -| `msg` | [`IMessageTransferable`](interfaces/IMessageTransferable.md) | -| `cb` | `ICallback`\<`void`\> | +| `consumer.dequeueMessage.error` | (`err`: `Error`, `consumerId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md)) => `void` | +| `consumer.dequeueMessage.messageReceived` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `consumerId`: `string`) => `void` | +| `consumer.dequeueMessage.nextMessage` | () => `void` | -##### Returns +___ -`void` +### TConsumerEvent -___ +Ƭ **TConsumerEvent**: `Object` -### TConsumerRedisKeys +#### Type declaration -Ƭ **TConsumerRedisKeys**: `ReturnType`\ +| Name | Type | +| :------ | :------ | +| `consumer.down` | (`consumerId`: `string`) => `void` | +| `consumer.error` | (`err`: `Error`, `consumerId`: `string`) => `void` | +| `consumer.goingDown` | (`consumerId`: `string`) => `void` | +| `consumer.goingUp` | (`consumerId`: `string`) => `void` | +| `consumer.up` | (`consumerId`: `string`) => `void` | ___ -### TEventListenersConfig +### TConsumerHeartbeatEvent + +Ƭ **TConsumerHeartbeatEvent**: `Object` + +#### Type declaration -Ƭ **TEventListenersConfig**: () => [`IEventListener`](interfaces/IEventListener.md)[] +| Name | Type | +| :------ | :------ | +| `consumerHeartbeat.error` | (`err`: `Error`) => `void` | +| `consumerHeartbeat.heartbeat` | (`consumerId`: `string`, `timestamp`: `number`, `heartbeatPayload`: [`IConsumerHeartbeat`](interfaces/IConsumerHeartbeat.md)) => `void` | ___ -### TExchange +### TConsumerMessageHandler -Ƭ **TExchange**: [`ExchangeDirect`](classes/ExchangeDirect.md) \| [`ExchangeTopic`](classes/ExchangeTopic.md) \| [`ExchangeFanOut`](classes/ExchangeFanOut.md) +Ƭ **TConsumerMessageHandler**: `string` \| [`TConsumerMessageHandlerFn`](README.md#tconsumermessagehandlerfn) ___ -### TExchangeDirectBindingParams +### TConsumerMessageHandlerEvent -Ƭ **TExchangeDirectBindingParams**: [`IQueueParams`](interfaces/IQueueParams.md) \| `string` +Ƭ **TConsumerMessageHandlerEvent**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `consumer.messageHandler.error` | (`err`: `Error`, `consumerId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md)) => `void` | ___ -### TExchangeFanOutBindingParams +### TConsumerMessageHandlerFn -Ƭ **TExchangeFanOutBindingParams**: `string` +Ƭ **TConsumerMessageHandlerFn**: (`msg`: [`IMessageTransferable`](interfaces/IMessageTransferable.md), `cb`: `ICallback`\<`void`\>) => `void` -___ +#### Type declaration -### TExchangeSerialized +▸ (`msg`, `cb`): `void` -Ƭ **TExchangeSerialized**: `ReturnType`\<[`ExchangeDirect`](classes/ExchangeDirect.md)[``"toJSON"``]\> \| `ReturnType`\<[`ExchangeTopic`](classes/ExchangeTopic.md)[``"toJSON"``]\> \| `ReturnType`\<[`ExchangeFanOut`](classes/ExchangeFanOut.md)[``"toJSON"``]\> +##### Parameters -___ +| Name | Type | +| :------ | :------ | +| `msg` | [`IMessageTransferable`](interfaces/IMessageTransferable.md) | +| `cb` | `ICallback`\<`void`\> | -### TExchangeTopicBindingParams +##### Returns -Ƭ **TExchangeTopicBindingParams**: [`TTopicParams`](README.md#ttopicparams) \| `string` +`void` ___ -### TMessageConsumeOptions +### TConsumerMessageHandlerRunnerEvent -Ƭ **TMessageConsumeOptions**: `Object` +Ƭ **TConsumerMessageHandlerRunnerEvent**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `consumeTimeout` | `number` | -| `retryDelay` | `number` | -| `retryThreshold` | `number` | -| `ttl` | `number` | +| `consumer.messageHandlerRunner.error` | (`err`: `Error`, `consumerId`: `string`) => `void` | ___ -### TQueueConsumer +### TConsumerRedisKeys -Ƭ **TQueueConsumer**: `Object` +Ƭ **TConsumerRedisKeys**: `ReturnType`\ + +___ + +### TEventBusEvent + +Ƭ **TEventBusEvent**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `createdAt` | `number` | -| `hostname` | `string` | -| `ipAddress` | `string`[] | -| `pid` | `number` | +| `error` | (`err`: `Error`) => `void` | ___ -### TQueueExtendedParams +### TExchangeDirectTransferable -Ƭ **TQueueExtendedParams**: `string` \| [`IQueueParams`](interfaces/IQueueParams.md) \| [`IQueueConsumerGroupParams`](interfaces/IQueueConsumerGroupParams.md) +Ƭ **TExchangeDirectTransferable**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `exchangeTag` | `string` | +| `params` | [`IQueueParams`](interfaces/IQueueParams.md) | +| `type` | [`DIRECT`](enums/EExchangeType.md#direct) | ___ -### TQueueMessagesPaginationParams +### TExchangeFanOutTransferable -Ƭ **TQueueMessagesPaginationParams**: `Object` +Ƭ **TExchangeFanOutTransferable**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `consumerGroupId?` | `string` \| ``null`` | -| `page` | `number` | -| `pageSize` | `number` | -| `queue` | `string` \| [`IQueueParams`](interfaces/IQueueParams.md) | +| `exchangeTag` | `string` | +| `params` | `string` | +| `type` | [`FANOUT`](enums/EExchangeType.md#fanout) | ___ -### TQueueMessagesParams +### TExchangeTopicTransferable -Ƭ **TQueueMessagesParams**: `Object` +Ƭ **TExchangeTopicTransferable**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `consumerGroupId?` | `string` \| ``null`` | -| `queue` | `string` \| [`IQueueParams`](interfaces/IQueueParams.md) | +| `exchangeTag` | `string` | +| `params` | [`ITopicParams`](interfaces/ITopicParams.md) | +| `type` | [`TOPIC`](enums/EExchangeType.md#topic) | ___ -### TRedisSMQEvent +### TExchangeTransferable -- [`TEvent`](https://github.com/weyoss/redis-smq-common/blob/master/docs/api/README.md#tevent) +Ƭ **TExchangeTransferable**: [`TExchangeDirectTransferable`](README.md#texchangedirecttransferable) \| [`TExchangeTopicTransferable`](README.md#texchangetopictransferable) \| [`TExchangeFanOutTransferable`](README.md#texchangefanouttransferable) - ↳ `TRedisSMQEvent`. +___ + +### TMessageConsumeOptions -Ƭ **TRedisSMQEvent** +Ƭ **TMessageConsumeOptions**: `Object` +#### Type declaration -| Event Name | Arguments | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `heartbeatTick` | (`timestamp`: `number`, `consumerId`: `string`, `heartbeatPayload`: [`IConsumerHeartbeat`](interfaces/IConsumerHeartbeat.md)) => `void` ; | -| `messageAcknowledged` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` ; | -| `messageDeadLettered` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `messageHandlerId`: `string`, `consumerId`: `string`, `cause`: [`EConsumeMessageDeadLetterCause`](enums/EConsumeMessageDeadLetterCause.md)) => `void` ; | -| `messageDelayed` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` ; | -| `messagePublished` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `producerId`: `string`) => `void` ; | -| `messageReceived` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `consumerId`: `string`) => `void` ; | -| `messageRequeued` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `messageHandlerId`: `string`, `consumerId`: `string`) => `void` ; | -| `messageUnacknowledged` | (`messageId`: `string`, `queue`: [`IQueueParams`](interfaces/IQueueParams.md), `messageHandlerId`: `string`, `consumerId`: `string`, `cause`: [`EConsumeMessageUnacknowledgedCause`](enums/EConsumeMessageUnacknowledgedCause.md)) => `void` ; | +| Name | Type | +| :------ | :------ | +| `consumeTimeout` | `number` | +| `retryDelay` | `number` | +| `retryThreshold` | `number` | +| `ttl` | `number` | ___ -### TTopicParams +### TProducerEvent -Ƭ **TTopicParams**: `Object` +Ƭ **TProducerEvent**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `ns` | `string` | -| `topic` | `string` | +| `producer.down` | (`producerId`: `string`) => `void` | +| `producer.error` | (`err`: `Error`, `producerId`: `string`) => `void` | +| `producer.goingDown` | (`producerId`: `string`) => `void` | +| `producer.goingUp` | (`producerId`: `string`) => `void` | +| `producer.messagePublished` | (`messageId`: `string`, `queue`: [`IQueueParsedParams`](interfaces/IQueueParsedParams.md), `producerId`: `string`) => `void` | +| `producer.up` | (`producerId`: `string`) => `void` | ___ -### TWorkerThreadError +### TQueueConsumer -Ƭ **TWorkerThreadError**: `Object` +Ƭ **TQueueConsumer**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `message` | `string` | -| `name` | `string` | +| `createdAt` | `number` | +| `hostname` | `string` | +| `ipAddress` | `string`[] | +| `pid` | `number` | ___ -### TWorkerThreadMessage +### TQueueEvent -Ƭ **TWorkerThreadMessage**: `Object` +Ƭ **TQueueEvent**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `code` | [`TWorkerThreadMessageCode`](README.md#tworkerthreadmessagecode) | -| `error` | [`TWorkerThreadError`](README.md#tworkerthreaderror) \| ``null`` | +| `queue.consumerGroupCreated` | (`queue`: [`IQueueParams`](interfaces/IQueueParams.md), `groupId`: `string`) => `void` | +| `queue.consumerGroupDeleted` | (`queue`: [`IQueueParams`](interfaces/IQueueParams.md), `groupId`: `string`) => `void` | +| `queue.queueCreated` | (`queue`: [`IQueueParams`](interfaces/IQueueParams.md), `properties`: [`IQueueProperties`](interfaces/IQueueProperties.md)) => `void` | +| `queue.queueDeleted` | (`queue`: [`IQueueParams`](interfaces/IQueueParams.md)) => `void` | ___ -### TWorkerThreadMessageCode +### TQueueExtendedParams -Ƭ **TWorkerThreadMessageCode**: [`EWorkerThreadMessageCodeExit`](enums/EWorkerThreadMessageCodeExit.md) \| [`EWorkerThreadMessageCodeConsume`](enums/EWorkerThreadMessageCodeConsume.md) +Ƭ **TQueueExtendedParams**: `string` \| [`IQueueParams`](interfaces/IQueueParams.md) \| [`IQueueConsumerGroupParams`](interfaces/IQueueConsumerGroupParams.md) -## Functions +___ -### disconnect +### TQueueMessagesPaginationParams -▸ **disconnect**(`cb`): `void` +Ƭ **TQueueMessagesPaginationParams**: `Object` -#### Parameters +#### Type declaration | Name | Type | | :------ | :------ | -| `cb` | `ICallback`\<`void`\> | +| `consumerGroupId?` | `string` \| ``null`` | +| `page` | `number` | +| `pageSize` | `number` | +| `queue` | `string` \| [`IQueueParams`](interfaces/IQueueParams.md) | -#### Returns +___ -`void` +### TQueueMessagesParams + +Ƭ **TQueueMessagesParams**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `consumerGroupId?` | `string` \| ``null`` | +| `queue` | `string` \| [`IQueueParams`](interfaces/IQueueParams.md) | + +___ + +### TRedisSMQEvent + +Ƭ **TRedisSMQEvent**: [`TEventBusEvent`](README.md#teventbusevent) & [`TConsumerEvent`](README.md#tconsumerevent) & [`TConsumerHeartbeatEvent`](README.md#tconsumerheartbeatevent) & [`TConsumerMessageHandlerRunnerEvent`](README.md#tconsumermessagehandlerrunnerevent) & [`TConsumerMessageHandlerEvent`](README.md#tconsumermessagehandlerevent) & [`TConsumerConsumeMessageEvent`](README.md#tconsumerconsumemessageevent) & [`TConsumerDequeueMessageEvent`](README.md#tconsumerdequeuemessageevent) & [`TProducerEvent`](README.md#tproducerevent) & [`TQueueEvent`](README.md#tqueueevent) diff --git a/docs/api/classes/Consumer.md b/docs/api/classes/Consumer.md index cc025922..e36a97f2 100644 --- a/docs/api/classes/Consumer.md +++ b/docs/api/classes/Consumer.md @@ -4,7 +4,7 @@ ## Hierarchy -- `Base` +- `Runnable`\<[`TConsumerEvent`](../README.md#tconsumerevent)\> ↳ **`Consumer`** @@ -18,14 +18,18 @@ - [cancel](Consumer.md#cancel) - [consume](Consumer.md#consume) +- [emit](Consumer.md#emit) - [getId](Consumer.md#getid) - [getQueues](Consumer.md#getqueues) -- [handleError](Consumer.md#handleerror) - [isDown](Consumer.md#isdown) - [isGoingDown](Consumer.md#isgoingdown) - [isGoingUp](Consumer.md#isgoingup) - [isRunning](Consumer.md#isrunning) - [isUp](Consumer.md#isup) +- [on](Consumer.md#on) +- [once](Consumer.md#once) +- [removeAllListeners](Consumer.md#removealllisteners) +- [removeListener](Consumer.md#removelistener) - [run](Consumer.md#run) - [shutdown](Consumer.md#shutdown) @@ -33,13 +37,13 @@ ### constructor -• **new Consumer**(`useMultiplexing?`): [`Consumer`](Consumer.md) +• **new Consumer**(`enableMultiplexing?`): [`Consumer`](Consumer.md) #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `useMultiplexing` | `boolean` | `false` | +| Name | Type | +| :------ | :------ | +| `enableMultiplexing?` | `boolean` | #### Returns @@ -47,7 +51,7 @@ #### Overrides -Base.constructor +Runnable\<TConsumerEvent\>.constructor ## Methods @@ -86,47 +90,54 @@ ___ ___ -### getId +### emit -▸ **getId**(): `string` +▸ **emit**\<`E`\>(`event`, `...args`): `boolean` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TConsumerEvent`](../README.md#tconsumerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `...args` | `Parameters`\<[`TConsumerEvent`](../README.md#tconsumerevent)[`E`]\> | #### Returns -`string` +`boolean` #### Inherited from -Base.getId +Runnable.emit ___ -### getQueues +### getId -▸ **getQueues**(): [`IQueueParsedParams`](../interfaces/IQueueParsedParams.md)[] +▸ **getId**(): `string` #### Returns -[`IQueueParsedParams`](../interfaces/IQueueParsedParams.md)[] +`string` -___ +#### Inherited from -### handleError +Runnable.getId -▸ **handleError**(`err`): `void` +___ -#### Parameters +### getQueues -| Name | Type | -| :------ | :------ | -| `err` | `Error` | +▸ **getQueues**(): [`IQueueParsedParams`](../interfaces/IQueueParsedParams.md)[] #### Returns -`void` - -#### Inherited from - -Base.handleError +[`IQueueParsedParams`](../interfaces/IQueueParsedParams.md)[] ___ @@ -140,7 +151,7 @@ ___ #### Inherited from -Base.isDown +Runnable.isDown ___ @@ -154,7 +165,7 @@ ___ #### Inherited from -Base.isGoingDown +Runnable.isGoingDown ___ @@ -168,7 +179,7 @@ ___ #### Inherited from -Base.isGoingUp +Runnable.isGoingUp ___ @@ -182,7 +193,7 @@ ___ #### Inherited from -Base.isRunning +Runnable.isRunning ___ @@ -196,19 +207,126 @@ ___ #### Inherited from -Base.isUp +Runnable.isUp + +___ + +### on + +▸ **on**\<`E`\>(`event`, `listener`): [`Consumer`](Consumer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TConsumerEvent`](../README.md#tconsumerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TConsumerEvent`](../README.md#tconsumerevent)[`E`] | + +#### Returns + +[`Consumer`](Consumer.md) + +#### Inherited from + +Runnable.on + +___ + +### once + +▸ **once**\<`E`\>(`event`, `listener`): [`Consumer`](Consumer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TConsumerEvent`](../README.md#tconsumerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TConsumerEvent`](../README.md#tconsumerevent)[`E`] | + +#### Returns + +[`Consumer`](Consumer.md) + +#### Inherited from + +Runnable.once + +___ + +### removeAllListeners + +▸ **removeAllListeners**\<`E`\>(`event?`): [`Consumer`](Consumer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TConsumerEvent`](../README.md#tconsumerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event?` | `Extract`\<`E`, `string`\> | + +#### Returns + +[`Consumer`](Consumer.md) + +#### Inherited from + +Runnable.removeAllListeners + +___ + +### removeListener + +▸ **removeListener**\<`E`\>(`event`, `listener`): [`Consumer`](Consumer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TConsumerEvent`](../README.md#tconsumerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TConsumerEvent`](../README.md#tconsumerevent)[`E`] | + +#### Returns + +[`Consumer`](Consumer.md) + +#### Inherited from + +Runnable.removeListener ___ ### run -▸ **run**(`cb?`): `void` +▸ **run**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb?` | `ICallback`\<`boolean`\> | +| `cb` | `ICallback`\<`boolean`\> | #### Returns @@ -216,19 +334,19 @@ ___ #### Inherited from -Base.run +Runnable.run ___ ### shutdown -▸ **shutdown**(`cb?`): `void` +▸ **shutdown**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb?` | `ICallback`\<`boolean`\> | +| `cb` | `ICallback`\<`void`\> | #### Returns @@ -236,4 +354,4 @@ ___ #### Inherited from -Base.shutdown +Runnable.shutdown diff --git a/docs/api/classes/ConsumerError.md b/docs/api/classes/ConsumerError.md index ffa65509..665730b6 100644 --- a/docs/api/classes/ConsumerError.md +++ b/docs/api/classes/ConsumerError.md @@ -20,14 +20,28 @@ ↳↳ [`ConsumerInvalidGroupIdError`](ConsumerInvalidGroupIdError.md) - ↳↳ [`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - ## Table of contents ### Constructors - [constructor](ConsumerError.md#constructor) +### Properties + +- [cause](ConsumerError.md#cause) +- [message](ConsumerError.md#message) +- [stack](ConsumerError.md#stack) +- [prepareStackTrace](ConsumerError.md#preparestacktrace) +- [stackTraceLimit](ConsumerError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerError.md#name) + +### Methods + +- [captureStackTrace](ConsumerError.md#capturestacktrace) + ## Constructors ### constructor @@ -47,3 +61,111 @@ #### Inherited from RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/ConsumerGroupDeleteError.md b/docs/api/classes/ConsumerGroupDeleteError.md index 47232c24..77a995f1 100644 --- a/docs/api/classes/ConsumerGroupDeleteError.md +++ b/docs/api/classes/ConsumerGroupDeleteError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerGroupDeleteError.md#constructor) +### Properties + +- [cause](ConsumerGroupDeleteError.md#cause) +- [message](ConsumerGroupDeleteError.md#message) +- [stack](ConsumerGroupDeleteError.md#stack) +- [prepareStackTrace](ConsumerGroupDeleteError.md#preparestacktrace) +- [stackTraceLimit](ConsumerGroupDeleteError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerGroupDeleteError.md#name) + +### Methods + +- [captureStackTrace](ConsumerGroupDeleteError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerGroupIdNotFoundError.md b/docs/api/classes/ConsumerGroupIdNotFoundError.md index b18d3a80..720dca8c 100644 --- a/docs/api/classes/ConsumerGroupIdNotFoundError.md +++ b/docs/api/classes/ConsumerGroupIdNotFoundError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerGroupIdNotFoundError.md#constructor) +### Properties + +- [cause](ConsumerGroupIdNotFoundError.md#cause) +- [message](ConsumerGroupIdNotFoundError.md#message) +- [stack](ConsumerGroupIdNotFoundError.md#stack) +- [prepareStackTrace](ConsumerGroupIdNotFoundError.md#preparestacktrace) +- [stackTraceLimit](ConsumerGroupIdNotFoundError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerGroupIdNotFoundError.md#name) + +### Methods + +- [captureStackTrace](ConsumerGroupIdNotFoundError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerGroupIdNotSupportedError.md b/docs/api/classes/ConsumerGroupIdNotSupportedError.md index f8023347..9b656fbc 100644 --- a/docs/api/classes/ConsumerGroupIdNotSupportedError.md +++ b/docs/api/classes/ConsumerGroupIdNotSupportedError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerGroupIdNotSupportedError.md#constructor) +### Properties + +- [cause](ConsumerGroupIdNotSupportedError.md#cause) +- [message](ConsumerGroupIdNotSupportedError.md#message) +- [stack](ConsumerGroupIdNotSupportedError.md#stack) +- [prepareStackTrace](ConsumerGroupIdNotSupportedError.md#preparestacktrace) +- [stackTraceLimit](ConsumerGroupIdNotSupportedError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerGroupIdNotSupportedError.md#name) + +### Methods + +- [captureStackTrace](ConsumerGroupIdNotSupportedError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerGroupIdRequiredError.md b/docs/api/classes/ConsumerGroupIdRequiredError.md index 4c2100d6..187cc2d0 100644 --- a/docs/api/classes/ConsumerGroupIdRequiredError.md +++ b/docs/api/classes/ConsumerGroupIdRequiredError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerGroupIdRequiredError.md#constructor) +### Properties + +- [cause](ConsumerGroupIdRequiredError.md#cause) +- [message](ConsumerGroupIdRequiredError.md#message) +- [stack](ConsumerGroupIdRequiredError.md#stack) +- [prepareStackTrace](ConsumerGroupIdRequiredError.md#preparestacktrace) +- [stackTraceLimit](ConsumerGroupIdRequiredError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerGroupIdRequiredError.md#name) + +### Methods + +- [captureStackTrace](ConsumerGroupIdRequiredError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerGroups.md b/docs/api/classes/ConsumerGroups.md index 8f1ccde1..ddacbae9 100644 --- a/docs/api/classes/ConsumerGroups.md +++ b/docs/api/classes/ConsumerGroups.md @@ -13,6 +13,7 @@ - [deleteConsumerGroup](ConsumerGroups.md#deleteconsumergroup) - [getConsumerGroups](ConsumerGroups.md#getconsumergroups) - [saveConsumerGroup](ConsumerGroups.md#saveconsumergroup) +- [shutdown](ConsumerGroups.md#shutdown) ## Constructors @@ -76,3 +77,19 @@ ___ #### Returns `void` + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/ConsumerInvalidGroupIdError.md b/docs/api/classes/ConsumerInvalidGroupIdError.md index 60f0fd1e..fbe8b2ab 100644 --- a/docs/api/classes/ConsumerInvalidGroupIdError.md +++ b/docs/api/classes/ConsumerInvalidGroupIdError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerInvalidGroupIdError.md#constructor) +### Properties + +- [cause](ConsumerInvalidGroupIdError.md#cause) +- [message](ConsumerInvalidGroupIdError.md#message) +- [stack](ConsumerInvalidGroupIdError.md#stack) +- [prepareStackTrace](ConsumerInvalidGroupIdError.md#preparestacktrace) +- [stackTraceLimit](ConsumerInvalidGroupIdError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerInvalidGroupIdError.md#name) + +### Methods + +- [captureStackTrace](ConsumerInvalidGroupIdError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerMessageHandlerAlreadyExistsError.md b/docs/api/classes/ConsumerMessageHandlerAlreadyExistsError.md index 3e6ff709..4dc09373 100644 --- a/docs/api/classes/ConsumerMessageHandlerAlreadyExistsError.md +++ b/docs/api/classes/ConsumerMessageHandlerAlreadyExistsError.md @@ -14,6 +14,22 @@ - [constructor](ConsumerMessageHandlerAlreadyExistsError.md#constructor) +### Properties + +- [cause](ConsumerMessageHandlerAlreadyExistsError.md#cause) +- [message](ConsumerMessageHandlerAlreadyExistsError.md#message) +- [stack](ConsumerMessageHandlerAlreadyExistsError.md#stack) +- [prepareStackTrace](ConsumerMessageHandlerAlreadyExistsError.md#preparestacktrace) +- [stackTraceLimit](ConsumerMessageHandlerAlreadyExistsError.md#stacktracelimit) + +### Accessors + +- [name](ConsumerMessageHandlerAlreadyExistsError.md#name) + +### Methods + +- [captureStackTrace](ConsumerMessageHandlerAlreadyExistsError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Overrides [ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[cause](ConsumerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[message](ConsumerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stack](ConsumerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ConsumerError](ConsumerError.md).[prepareStackTrace](ConsumerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[stackTraceLimit](ConsumerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ConsumerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ConsumerError](ConsumerError.md).[captureStackTrace](ConsumerError.md#capturestacktrace) diff --git a/docs/api/classes/ConsumerMessageHandlerError.md b/docs/api/classes/ConsumerMessageHandlerError.md deleted file mode 100644 index 7b800e72..00000000 --- a/docs/api/classes/ConsumerMessageHandlerError.md +++ /dev/null @@ -1,37 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ConsumerMessageHandlerError - -# Class: ConsumerMessageHandlerError - -## Hierarchy - -- [`ConsumerError`](ConsumerError.md) - - ↳ **`ConsumerMessageHandlerError`** - - ↳↳ [`ConsumerMessageHandlerWorkerError`](ConsumerMessageHandlerWorkerError.md) - -## Table of contents - -### Constructors - -- [constructor](ConsumerMessageHandlerError.md#constructor) - -## Constructors - -### constructor - -• **new ConsumerMessageHandlerError**(`msg?`): [`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg?` | `string` | - -#### Returns - -[`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - -#### Overrides - -[ConsumerError](ConsumerError.md).[constructor](ConsumerError.md#constructor) diff --git a/docs/api/classes/ConsumerMessageHandlerFileError.md b/docs/api/classes/ConsumerMessageHandlerFileError.md deleted file mode 100644 index 0d9d3b1a..00000000 --- a/docs/api/classes/ConsumerMessageHandlerFileError.md +++ /dev/null @@ -1,29 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ConsumerMessageHandlerFileError - -# Class: ConsumerMessageHandlerFileError - -## Hierarchy - -- [`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - - ↳ **`ConsumerMessageHandlerFileError`** - -## Table of contents - -### Constructors - -- [constructor](ConsumerMessageHandlerFileError.md#constructor) - -## Constructors - -### constructor - -• **new ConsumerMessageHandlerFileError**(): [`ConsumerMessageHandlerFileError`](ConsumerMessageHandlerFileError.md) - -#### Returns - -[`ConsumerMessageHandlerFileError`](ConsumerMessageHandlerFileError.md) - -#### Overrides - -[ConsumerMessageHandlerError](ConsumerMessageHandlerError.md).[constructor](ConsumerMessageHandlerError.md#constructor) diff --git a/docs/api/classes/ConsumerMessageHandlerFilenameExtensionError.md b/docs/api/classes/ConsumerMessageHandlerFilenameExtensionError.md deleted file mode 100644 index bf72b17b..00000000 --- a/docs/api/classes/ConsumerMessageHandlerFilenameExtensionError.md +++ /dev/null @@ -1,29 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ConsumerMessageHandlerFilenameExtensionError - -# Class: ConsumerMessageHandlerFilenameExtensionError - -## Hierarchy - -- [`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - - ↳ **`ConsumerMessageHandlerFilenameExtensionError`** - -## Table of contents - -### Constructors - -- [constructor](ConsumerMessageHandlerFilenameExtensionError.md#constructor) - -## Constructors - -### constructor - -• **new ConsumerMessageHandlerFilenameExtensionError**(): [`ConsumerMessageHandlerFilenameExtensionError`](ConsumerMessageHandlerFilenameExtensionError.md) - -#### Returns - -[`ConsumerMessageHandlerFilenameExtensionError`](ConsumerMessageHandlerFilenameExtensionError.md) - -#### Overrides - -[ConsumerMessageHandlerError](ConsumerMessageHandlerError.md).[constructor](ConsumerMessageHandlerError.md#constructor) diff --git a/docs/api/classes/ConsumerMessageHandlerWorkerError.md b/docs/api/classes/ConsumerMessageHandlerWorkerError.md deleted file mode 100644 index 204049a9..00000000 --- a/docs/api/classes/ConsumerMessageHandlerWorkerError.md +++ /dev/null @@ -1,35 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ConsumerMessageHandlerWorkerError - -# Class: ConsumerMessageHandlerWorkerError - -## Hierarchy - -- [`ConsumerMessageHandlerError`](ConsumerMessageHandlerError.md) - - ↳ **`ConsumerMessageHandlerWorkerError`** - -## Table of contents - -### Constructors - -- [constructor](ConsumerMessageHandlerWorkerError.md#constructor) - -## Constructors - -### constructor - -• **new ConsumerMessageHandlerWorkerError**(`msg`): [`ConsumerMessageHandlerWorkerError`](ConsumerMessageHandlerWorkerError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | [`TWorkerThreadMessage`](../README.md#tworkerthreadmessage) | - -#### Returns - -[`ConsumerMessageHandlerWorkerError`](ConsumerMessageHandlerWorkerError.md) - -#### Overrides - -[ConsumerMessageHandlerError](ConsumerMessageHandlerError.md).[constructor](ConsumerMessageHandlerError.md#constructor) diff --git a/docs/api/classes/EventBusRedisInstance.md b/docs/api/classes/EventBusRedisInstance.md new file mode 100644 index 00000000..311b741b --- /dev/null +++ b/docs/api/classes/EventBusRedisInstance.md @@ -0,0 +1,235 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EventBusRedisInstance + +# Class: EventBusRedisInstance + +## Hierarchy + +- `EventEmitter`\<`Pick`\<`TRedisClientEvent`, ``"error"``\>\> + + ↳ **`EventBusRedisInstance`** + +## Table of contents + +### Constructors + +- [constructor](EventBusRedisInstance.md#constructor) + +### Methods + +- [emit](EventBusRedisInstance.md#emit) +- [getInstance](EventBusRedisInstance.md#getinstance) +- [getSetInstance](EventBusRedisInstance.md#getsetinstance) +- [init](EventBusRedisInstance.md#init) +- [on](EventBusRedisInstance.md#on) +- [once](EventBusRedisInstance.md#once) +- [removeAllListeners](EventBusRedisInstance.md#removealllisteners) +- [removeListener](EventBusRedisInstance.md#removelistener) +- [shutdown](EventBusRedisInstance.md#shutdown) + +## Constructors + +### constructor + +• **new EventBusRedisInstance**(): [`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Returns + +[`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Inherited from + +EventEmitter\< + Pick\ +\>.constructor + +## Methods + +### emit + +▸ **emit**\<`E`\>(`event`, `...args`): `boolean` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends ``"error"`` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `...args` | `Parameters`\<`Pick`\<`TRedisClientEvent`, ``"error"``\>[`E`]\> | + +#### Returns + +`boolean` + +#### Inherited from + +EventEmitter.emit + +___ + +### getInstance + +▸ **getInstance**(): `Error` \| `IEventBus`\<[`TRedisSMQEvent`](../README.md#tredissmqevent)\> + +#### Returns + +`Error` \| `IEventBus`\<[`TRedisSMQEvent`](../README.md#tredissmqevent)\> + +___ + +### getSetInstance + +▸ **getSetInstance**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`IEventBus`\<[`TRedisSMQEvent`](../README.md#tredissmqevent)\>\> | + +#### Returns + +`void` + +___ + +### init + +▸ **init**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` + +___ + +### on + +▸ **on**\<`E`\>(`event`, `listener`): [`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends ``"error"`` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | `Pick`\<`TRedisClientEvent`, ``"error"``\>[`E`] | + +#### Returns + +[`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Inherited from + +EventEmitter.on + +___ + +### once + +▸ **once**\<`E`\>(`event`, `listener`): [`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends ``"error"`` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | `Pick`\<`TRedisClientEvent`, ``"error"``\>[`E`] | + +#### Returns + +[`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Inherited from + +EventEmitter.once + +___ + +### removeAllListeners + +▸ **removeAllListeners**\<`E`\>(`event?`): [`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends ``"error"`` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event?` | `Extract`\<`E`, `string`\> | + +#### Returns + +[`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Inherited from + +EventEmitter.removeAllListeners + +___ + +### removeListener + +▸ **removeListener**\<`E`\>(`event`, `listener`): [`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends ``"error"`` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | `Pick`\<`TRedisClientEvent`, ``"error"``\>[`E`] | + +#### Returns + +[`EventBusRedisInstance`](EventBusRedisInstance.md) + +#### Inherited from + +EventEmitter.removeListener + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/ExchangeDirect.md b/docs/api/classes/ExchangeDirect.md index 19643184..f519f194 100644 --- a/docs/api/classes/ExchangeDirect.md +++ b/docs/api/classes/ExchangeDirect.md @@ -4,7 +4,7 @@ ## Hierarchy -- `Exchange`\<[`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams), [`DIRECT`](../enums/EExchangeType.md#direct)\> +- `ExchangeAbstract`\<`string` \| [`IQueueParams`](../interfaces/IQueueParams.md)\> ↳ **`ExchangeDirect`** @@ -14,136 +14,62 @@ - [constructor](ExchangeDirect.md#constructor) -### Properties - -- [bindingParams](ExchangeDirect.md#bindingparams) -- [exchangeTag](ExchangeDirect.md#exchangetag) -- [type](ExchangeDirect.md#type) - ### Methods -- [fromJSON](ExchangeDirect.md#fromjson) -- [getBindingParams](ExchangeDirect.md#getbindingparams) - [getQueues](ExchangeDirect.md#getqueues) -- [toJSON](ExchangeDirect.md#tojson) +- [shutdown](ExchangeDirect.md#shutdown) ## Constructors ### constructor -• **new ExchangeDirect**(`queue`): [`ExchangeDirect`](ExchangeDirect.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `queue` | [`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams) | +• **new ExchangeDirect**(): [`ExchangeDirect`](ExchangeDirect.md) #### Returns [`ExchangeDirect`](ExchangeDirect.md) -#### Overrides - -Exchange\< - TExchangeDirectBindingParams, - EExchangeType.DIRECT -\>.constructor - -## Properties - -### bindingParams - -• `Readonly` **bindingParams**: [`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams) - -#### Inherited from - -Exchange.bindingParams - -___ - -### exchangeTag - -• **exchangeTag**: `string` - -#### Inherited from - -Exchange.exchangeTag - -___ - -### type - -• `Readonly` **type**: [`DIRECT`](../enums/EExchangeType.md#direct) - #### Inherited from -Exchange.type +ExchangeAbstract\.constructor ## Methods -### fromJSON +### getQueues -▸ **fromJSON**(`JSON`): `void` +▸ **getQueues**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `JSON` | `Partial`\<[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams), [`DIRECT`](../enums/EExchangeType.md#direct)\>\> | +| `exchangeParams` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | +| `cb` | `ICallback`\<[`IQueueParams`](../interfaces/IQueueParams.md)[]\> | #### Returns `void` -#### Inherited from - -Exchange.fromJSON - -___ - -### getBindingParams - -▸ **getBindingParams**(): [`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams) - -#### Returns - -[`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams) - -#### Inherited from +#### Overrides -Exchange.getBindingParams +ExchangeAbstract.getQueues ___ -### getQueues +### shutdown -▸ **getQueues**(`cb`): `void` +▸ **shutdown**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb` | `ICallback`\<[`IQueueParams`](../interfaces/IQueueParams.md)[]\> | +| `cb` | `ICallback`\<`void`\> | #### Returns `void` -#### Overrides - -Exchange.getQueues - -___ - -### toJSON - -▸ **toJSON**(): [`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams), [`DIRECT`](../enums/EExchangeType.md#direct)\> - -#### Returns - -[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeDirectBindingParams`](../README.md#texchangedirectbindingparams), [`DIRECT`](../enums/EExchangeType.md#direct)\> - #### Inherited from -Exchange.toJSON +ExchangeAbstract.shutdown diff --git a/docs/api/classes/ExchangeError.md b/docs/api/classes/ExchangeError.md index 36bb0faf..c7e0ca3c 100644 --- a/docs/api/classes/ExchangeError.md +++ b/docs/api/classes/ExchangeError.md @@ -18,6 +18,22 @@ - [constructor](ExchangeError.md#constructor) +### Properties + +- [cause](ExchangeError.md#cause) +- [message](ExchangeError.md#message) +- [stack](ExchangeError.md#stack) +- [prepareStackTrace](ExchangeError.md#preparestacktrace) +- [stackTraceLimit](ExchangeError.md#stacktracelimit) + +### Accessors + +- [name](ExchangeError.md#name) + +### Methods + +- [captureStackTrace](ExchangeError.md#capturestacktrace) + ## Constructors ### constructor @@ -37,3 +53,111 @@ #### Inherited from RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/ExchangeFanOut.md b/docs/api/classes/ExchangeFanOut.md index 6d72fb21..84fd8561 100644 --- a/docs/api/classes/ExchangeFanOut.md +++ b/docs/api/classes/ExchangeFanOut.md @@ -4,7 +4,7 @@ ## Hierarchy -- `Exchange`\<[`TExchangeFanOutBindingParams`](../README.md#texchangefanoutbindingparams), [`FANOUT`](../enums/EExchangeType.md#fanout)\> +- `ExchangeAbstract`\<`string`\> ↳ **`ExchangeFanOut`** @@ -14,89 +14,43 @@ - [constructor](ExchangeFanOut.md#constructor) -### Properties - -- [bindingParams](ExchangeFanOut.md#bindingparams) -- [exchangeTag](ExchangeFanOut.md#exchangetag) -- [type](ExchangeFanOut.md#type) - ### Methods - [bindQueue](ExchangeFanOut.md#bindqueue) - [deleteExchange](ExchangeFanOut.md#deleteexchange) -- [fromJSON](ExchangeFanOut.md#fromjson) -- [getBindingParams](ExchangeFanOut.md#getbindingparams) +- [getAllExchanges](ExchangeFanOut.md#getallexchanges) +- [getQueueExchange](ExchangeFanOut.md#getqueueexchange) - [getQueues](ExchangeFanOut.md#getqueues) - [saveExchange](ExchangeFanOut.md#saveexchange) -- [toJSON](ExchangeFanOut.md#tojson) +- [shutdown](ExchangeFanOut.md#shutdown) - [unbindQueue](ExchangeFanOut.md#unbindqueue) -- [getAllExchanges](ExchangeFanOut.md#getallexchanges) -- [getQueueExchange](ExchangeFanOut.md#getqueueexchange) ## Constructors ### constructor -• **new ExchangeFanOut**(`fanOutName`): [`ExchangeFanOut`](ExchangeFanOut.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `fanOutName` | `string` | +• **new ExchangeFanOut**(): [`ExchangeFanOut`](ExchangeFanOut.md) #### Returns [`ExchangeFanOut`](ExchangeFanOut.md) -#### Overrides - -Exchange\< - TExchangeFanOutBindingParams, - EExchangeType.FANOUT -\>.constructor - -## Properties - -### bindingParams - -• `Readonly` **bindingParams**: `string` - #### Inherited from -Exchange.bindingParams - -___ - -### exchangeTag - -• **exchangeTag**: `string` - -#### Inherited from - -Exchange.exchangeTag - -___ - -### type - -• `Readonly` **type**: [`FANOUT`](../enums/EExchangeType.md#fanout) - -#### Inherited from - -Exchange.type +ExchangeAbstract\.constructor ## Methods ### bindQueue -▸ **bindQueue**(`queue`, `cb`): `void` +▸ **bindQueue**(`queue`, `exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | | `queue` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | +| `exchangeParams` | `string` | | `cb` | `ICallback`\<`void`\> | #### Returns @@ -107,12 +61,13 @@ ___ ### deleteExchange -▸ **deleteExchange**(`cb`): `void` +▸ **deleteExchange**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | +| `exchangeParams` | `string` | | `cb` | `ICallback`\<`void`\> | #### Returns @@ -121,48 +76,48 @@ ___ ___ -### fromJSON +### getAllExchanges -▸ **fromJSON**(`JSON`): `void` +▸ **getAllExchanges**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `JSON` | `Partial`\<[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<`string`, [`FANOUT`](../enums/EExchangeType.md#fanout)\>\> | +| `cb` | `ICallback`\<`string`[]\> | #### Returns `void` -#### Inherited from - -Exchange.fromJSON - ___ -### getBindingParams +### getQueueExchange -▸ **getBindingParams**(): `string` +▸ **getQueueExchange**(`queue`, `cb`): `void` -#### Returns +#### Parameters -`string` +| Name | Type | +| :------ | :------ | +| `queue` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | +| `cb` | `ICallback`\<``null`` \| `string`\> | -#### Inherited from +#### Returns -Exchange.getBindingParams +`void` ___ ### getQueues -▸ **getQueues**(`cb`): `void` +▸ **getQueues**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | +| `exchangeParams` | `string` | | `cb` | `ICallback`\<[`IQueueParams`](../interfaces/IQueueParams.md)[]\> | #### Returns @@ -171,18 +126,19 @@ ___ #### Overrides -Exchange.getQueues +ExchangeAbstract.getQueues ___ ### saveExchange -▸ **saveExchange**(`cb`): `void` +▸ **saveExchange**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | +| `exchangeParams` | `string` | | `cb` | `ICallback`\<`void`\> | #### Returns @@ -191,63 +147,37 @@ ___ ___ -### toJSON - -▸ **toJSON**(): [`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<`string`, [`FANOUT`](../enums/EExchangeType.md#fanout)\> - -#### Returns - -[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<`string`, [`FANOUT`](../enums/EExchangeType.md#fanout)\> - -#### Inherited from - -Exchange.toJSON - -___ - -### unbindQueue +### shutdown -▸ **unbindQueue**(`queue`, `cb`): `void` +▸ **shutdown**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `queue` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | | `cb` | `ICallback`\<`void`\> | #### Returns `void` -___ - -### getAllExchanges - -▸ **getAllExchanges**(`cb`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | `ICallback`\<`string`[]\> | - -#### Returns +#### Inherited from -`void` +ExchangeAbstract.shutdown ___ -### getQueueExchange +### unbindQueue -▸ **getQueueExchange**(`queue`, `cb`): `void` +▸ **unbindQueue**(`queue`, `exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | | `queue` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | -| `cb` | `ICallback`\<``null`` \| [`ExchangeFanOut`](ExchangeFanOut.md)\> | +| `exchangeParams` | `string` | +| `cb` | `ICallback`\<`void`\> | #### Returns diff --git a/docs/api/classes/ExchangeFanOutError.md b/docs/api/classes/ExchangeFanOutError.md index 363832a8..405da7c5 100644 --- a/docs/api/classes/ExchangeFanOutError.md +++ b/docs/api/classes/ExchangeFanOutError.md @@ -14,6 +14,22 @@ - [constructor](ExchangeFanOutError.md#constructor) +### Properties + +- [cause](ExchangeFanOutError.md#cause) +- [message](ExchangeFanOutError.md#message) +- [stack](ExchangeFanOutError.md#stack) +- [prepareStackTrace](ExchangeFanOutError.md#preparestacktrace) +- [stackTraceLimit](ExchangeFanOutError.md#stacktracelimit) + +### Accessors + +- [name](ExchangeFanOutError.md#name) + +### Methods + +- [captureStackTrace](ExchangeFanOutError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ExchangeError](ExchangeError.md).[constructor](ExchangeError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[cause](ExchangeError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[message](ExchangeError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[stack](ExchangeError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ExchangeError](ExchangeError.md).[prepareStackTrace](ExchangeError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[stackTraceLimit](ExchangeError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ExchangeError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[captureStackTrace](ExchangeError.md#capturestacktrace) diff --git a/docs/api/classes/ExchangeInvalidDataError.md b/docs/api/classes/ExchangeInvalidDataError.md index be0d57f2..6e6e2a27 100644 --- a/docs/api/classes/ExchangeInvalidDataError.md +++ b/docs/api/classes/ExchangeInvalidDataError.md @@ -14,6 +14,22 @@ - [constructor](ExchangeInvalidDataError.md#constructor) +### Properties + +- [cause](ExchangeInvalidDataError.md#cause) +- [message](ExchangeInvalidDataError.md#message) +- [stack](ExchangeInvalidDataError.md#stack) +- [prepareStackTrace](ExchangeInvalidDataError.md#preparestacktrace) +- [stackTraceLimit](ExchangeInvalidDataError.md#stacktracelimit) + +### Accessors + +- [name](ExchangeInvalidDataError.md#name) + +### Methods + +- [captureStackTrace](ExchangeInvalidDataError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ExchangeError](ExchangeError.md).[constructor](ExchangeError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[cause](ExchangeError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[message](ExchangeError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[stack](ExchangeError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ExchangeError](ExchangeError.md).[prepareStackTrace](ExchangeError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[stackTraceLimit](ExchangeError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ExchangeError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ExchangeError](ExchangeError.md).[captureStackTrace](ExchangeError.md#capturestacktrace) diff --git a/docs/api/classes/ExchangeTopic.md b/docs/api/classes/ExchangeTopic.md index b9debbde..8d3eb8da 100644 --- a/docs/api/classes/ExchangeTopic.md +++ b/docs/api/classes/ExchangeTopic.md @@ -4,7 +4,7 @@ ## Hierarchy -- `Exchange`\<[`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams), [`TOPIC`](../enums/EExchangeType.md#topic)\> +- `ExchangeAbstract`\<`string` \| [`ITopicParams`](../interfaces/ITopicParams.md)\> ↳ **`ExchangeTopic`** @@ -14,136 +14,62 @@ - [constructor](ExchangeTopic.md#constructor) -### Properties - -- [bindingParams](ExchangeTopic.md#bindingparams) -- [exchangeTag](ExchangeTopic.md#exchangetag) -- [type](ExchangeTopic.md#type) - ### Methods -- [fromJSON](ExchangeTopic.md#fromjson) -- [getBindingParams](ExchangeTopic.md#getbindingparams) - [getQueues](ExchangeTopic.md#getqueues) -- [toJSON](ExchangeTopic.md#tojson) +- [shutdown](ExchangeTopic.md#shutdown) ## Constructors ### constructor -• **new ExchangeTopic**(`topic`): [`ExchangeTopic`](ExchangeTopic.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `topic` | [`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams) | +• **new ExchangeTopic**(): [`ExchangeTopic`](ExchangeTopic.md) #### Returns [`ExchangeTopic`](ExchangeTopic.md) -#### Overrides - -Exchange\< - TExchangeTopicBindingParams, - EExchangeType.TOPIC -\>.constructor - -## Properties - -### bindingParams - -• `Readonly` **bindingParams**: [`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams) - -#### Inherited from - -Exchange.bindingParams - -___ - -### exchangeTag - -• **exchangeTag**: `string` - -#### Inherited from - -Exchange.exchangeTag - -___ - -### type - -• `Readonly` **type**: [`TOPIC`](../enums/EExchangeType.md#topic) - #### Inherited from -Exchange.type +ExchangeAbstract\.constructor ## Methods -### fromJSON +### getQueues -▸ **fromJSON**(`JSON`): `void` +▸ **getQueues**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `JSON` | `Partial`\<[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams), [`TOPIC`](../enums/EExchangeType.md#topic)\>\> | +| `exchangeParams` | `string` \| [`ITopicParams`](../interfaces/ITopicParams.md) | +| `cb` | `ICallback`\<[`IQueueParams`](../interfaces/IQueueParams.md)[]\> | #### Returns `void` -#### Inherited from - -Exchange.fromJSON - -___ - -### getBindingParams - -▸ **getBindingParams**(): [`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams) - -#### Returns - -[`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams) - -#### Inherited from +#### Overrides -Exchange.getBindingParams +ExchangeAbstract.getQueues ___ -### getQueues +### shutdown -▸ **getQueues**(`cb`): `void` +▸ **shutdown**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb` | `ICallback`\<[`IQueueParams`](../interfaces/IQueueParams.md)[]\> | +| `cb` | `ICallback`\<`void`\> | #### Returns `void` -#### Overrides - -Exchange.getQueues - -___ - -### toJSON - -▸ **toJSON**(): [`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams), [`TOPIC`](../enums/EExchangeType.md#topic)\> - -#### Returns - -[`IExchangeSerialized`](../interfaces/IExchangeSerialized.md)\<[`TExchangeTopicBindingParams`](../README.md#texchangetopicbindingparams), [`TOPIC`](../enums/EExchangeType.md#topic)\> - #### Inherited from -Exchange.toJSON +ExchangeAbstract.shutdown diff --git a/docs/api/classes/Message.md b/docs/api/classes/Message.md index 0f8b8193..8f8a0147 100644 --- a/docs/api/classes/Message.md +++ b/docs/api/classes/Message.md @@ -16,6 +16,7 @@ - [getMessageState](Message.md#getmessagestate) - [getMessageStatus](Message.md#getmessagestatus) - [getMessagesByIds](Message.md#getmessagesbyids) +- [shutdown](Message.md#shutdown) ## Constructors @@ -128,3 +129,19 @@ ___ #### Returns `void` + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/MessageDeleteError.md b/docs/api/classes/MessageDeleteError.md index d05f83c8..c88bd191 100644 --- a/docs/api/classes/MessageDeleteError.md +++ b/docs/api/classes/MessageDeleteError.md @@ -14,6 +14,22 @@ - [constructor](MessageDeleteError.md#constructor) +### Properties + +- [cause](MessageDeleteError.md#cause) +- [message](MessageDeleteError.md#message) +- [stack](MessageDeleteError.md#stack) +- [prepareStackTrace](MessageDeleteError.md#preparestacktrace) +- [stackTraceLimit](MessageDeleteError.md#stacktracelimit) + +### Accessors + +- [name](MessageDeleteError.md#name) + +### Methods + +- [captureStackTrace](MessageDeleteError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Overrides [MessageError](MessageError.md).[constructor](MessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[MessageError](MessageError.md).[cause](MessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[message](MessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[stack](MessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[MessageError](MessageError.md).[prepareStackTrace](MessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[MessageError](MessageError.md).[stackTraceLimit](MessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[MessageError](MessageError.md).[captureStackTrace](MessageError.md#capturestacktrace) diff --git a/docs/api/classes/MessageDestinationQueueAlreadySetError.md b/docs/api/classes/MessageDestinationQueueAlreadySetError.md index 2b069684..e7e97f9c 100644 --- a/docs/api/classes/MessageDestinationQueueAlreadySetError.md +++ b/docs/api/classes/MessageDestinationQueueAlreadySetError.md @@ -14,6 +14,22 @@ - [constructor](MessageDestinationQueueAlreadySetError.md#constructor) +### Properties + +- [cause](MessageDestinationQueueAlreadySetError.md#cause) +- [message](MessageDestinationQueueAlreadySetError.md#message) +- [stack](MessageDestinationQueueAlreadySetError.md#stack) +- [prepareStackTrace](MessageDestinationQueueAlreadySetError.md#preparestacktrace) +- [stackTraceLimit](MessageDestinationQueueAlreadySetError.md#stacktracelimit) + +### Accessors + +- [name](MessageDestinationQueueAlreadySetError.md#name) + +### Methods + +- [captureStackTrace](MessageDestinationQueueAlreadySetError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [MessageError](MessageError.md).[constructor](MessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[MessageError](MessageError.md).[cause](MessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[message](MessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[stack](MessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[MessageError](MessageError.md).[prepareStackTrace](MessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[MessageError](MessageError.md).[stackTraceLimit](MessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[MessageError](MessageError.md).[captureStackTrace](MessageError.md#capturestacktrace) diff --git a/docs/api/classes/MessageDestinationQueueRequiredError.md b/docs/api/classes/MessageDestinationQueueRequiredError.md index f73d50ab..2ef5dc43 100644 --- a/docs/api/classes/MessageDestinationQueueRequiredError.md +++ b/docs/api/classes/MessageDestinationQueueRequiredError.md @@ -14,6 +14,22 @@ - [constructor](MessageDestinationQueueRequiredError.md#constructor) +### Properties + +- [cause](MessageDestinationQueueRequiredError.md#cause) +- [message](MessageDestinationQueueRequiredError.md#message) +- [stack](MessageDestinationQueueRequiredError.md#stack) +- [prepareStackTrace](MessageDestinationQueueRequiredError.md#preparestacktrace) +- [stackTraceLimit](MessageDestinationQueueRequiredError.md#stacktracelimit) + +### Accessors + +- [name](MessageDestinationQueueRequiredError.md#name) + +### Methods + +- [captureStackTrace](MessageDestinationQueueRequiredError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [MessageError](MessageError.md).[constructor](MessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[MessageError](MessageError.md).[cause](MessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[message](MessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[stack](MessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[MessageError](MessageError.md).[prepareStackTrace](MessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[MessageError](MessageError.md).[stackTraceLimit](MessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[MessageError](MessageError.md).[captureStackTrace](MessageError.md#capturestacktrace) diff --git a/docs/api/classes/MessageError.md b/docs/api/classes/MessageError.md index 06031b62..7c0d5f18 100644 --- a/docs/api/classes/MessageError.md +++ b/docs/api/classes/MessageError.md @@ -24,6 +24,22 @@ - [constructor](MessageError.md#constructor) +### Properties + +- [cause](MessageError.md#cause) +- [message](MessageError.md#message) +- [stack](MessageError.md#stack) +- [prepareStackTrace](MessageError.md#preparestacktrace) +- [stackTraceLimit](MessageError.md#stacktracelimit) + +### Accessors + +- [name](MessageError.md#name) + +### Methods + +- [captureStackTrace](MessageError.md#capturestacktrace) + ## Constructors ### constructor @@ -43,3 +59,111 @@ #### Inherited from RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/MessageExchangeRequiredError.md b/docs/api/classes/MessageExchangeRequiredError.md index 0e4bdef3..cd5cc69d 100644 --- a/docs/api/classes/MessageExchangeRequiredError.md +++ b/docs/api/classes/MessageExchangeRequiredError.md @@ -14,6 +14,22 @@ - [constructor](MessageExchangeRequiredError.md#constructor) +### Properties + +- [cause](MessageExchangeRequiredError.md#cause) +- [message](MessageExchangeRequiredError.md#message) +- [stack](MessageExchangeRequiredError.md#stack) +- [prepareStackTrace](MessageExchangeRequiredError.md#preparestacktrace) +- [stackTraceLimit](MessageExchangeRequiredError.md#stacktracelimit) + +### Accessors + +- [name](MessageExchangeRequiredError.md#name) + +### Methods + +- [captureStackTrace](MessageExchangeRequiredError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [MessageError](MessageError.md).[constructor](MessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[MessageError](MessageError.md).[cause](MessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[message](MessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[stack](MessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[MessageError](MessageError.md).[prepareStackTrace](MessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[MessageError](MessageError.md).[stackTraceLimit](MessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[MessageError](MessageError.md).[captureStackTrace](MessageError.md#capturestacktrace) diff --git a/docs/api/classes/MessageNotFoundError.md b/docs/api/classes/MessageNotFoundError.md index 41526714..76ea0164 100644 --- a/docs/api/classes/MessageNotFoundError.md +++ b/docs/api/classes/MessageNotFoundError.md @@ -14,6 +14,22 @@ - [constructor](MessageNotFoundError.md#constructor) +### Properties + +- [cause](MessageNotFoundError.md#cause) +- [message](MessageNotFoundError.md#message) +- [stack](MessageNotFoundError.md#stack) +- [prepareStackTrace](MessageNotFoundError.md#preparestacktrace) +- [stackTraceLimit](MessageNotFoundError.md#stacktracelimit) + +### Accessors + +- [name](MessageNotFoundError.md#name) + +### Methods + +- [captureStackTrace](MessageNotFoundError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Overrides [MessageError](MessageError.md).[constructor](MessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[MessageError](MessageError.md).[cause](MessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[message](MessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[MessageError](MessageError.md).[stack](MessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[MessageError](MessageError.md).[prepareStackTrace](MessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[MessageError](MessageError.md).[stackTraceLimit](MessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +MessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[MessageError](MessageError.md).[captureStackTrace](MessageError.md#capturestacktrace) diff --git a/docs/api/classes/MessageRequeueError.md b/docs/api/classes/MessageRequeueError.md new file mode 100644 index 00000000..d030a14f --- /dev/null +++ b/docs/api/classes/MessageRequeueError.md @@ -0,0 +1,159 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / MessageRequeueError + +# Class: MessageRequeueError + +## Hierarchy + +- [`QueueMessageError`](QueueMessageError.md) + + ↳ **`MessageRequeueError`** + +## Table of contents + +### Constructors + +- [constructor](MessageRequeueError.md#constructor) + +### Properties + +- [cause](MessageRequeueError.md#cause) +- [message](MessageRequeueError.md#message) +- [stack](MessageRequeueError.md#stack) +- [prepareStackTrace](MessageRequeueError.md#preparestacktrace) +- [stackTraceLimit](MessageRequeueError.md#stacktracelimit) + +### Accessors + +- [name](MessageRequeueError.md#name) + +### Methods + +- [captureStackTrace](MessageRequeueError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new MessageRequeueError**(`msg?`): [`MessageRequeueError`](MessageRequeueError.md) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `msg` | `string` | `'MESSAGE_REQUEUE_ERROR'` | + +#### Returns + +[`MessageRequeueError`](MessageRequeueError.md) + +#### Overrides + +[QueueMessageError](QueueMessageError.md).[constructor](QueueMessageError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[cause](QueueMessageError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[message](QueueMessageError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[stack](QueueMessageError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[prepareStackTrace](QueueMessageError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[stackTraceLimit](QueueMessageError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +QueueMessageError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[QueueMessageError](QueueMessageError.md).[captureStackTrace](QueueMessageError.md#capturestacktrace) diff --git a/docs/api/classes/Namespace.md b/docs/api/classes/Namespace.md index cec9793c..8f1bf7e4 100644 --- a/docs/api/classes/Namespace.md +++ b/docs/api/classes/Namespace.md @@ -13,6 +13,7 @@ - [delete](Namespace.md#delete) - [getNamespaceQueues](Namespace.md#getnamespacequeues) - [getNamespaces](Namespace.md#getnamespaces) +- [shutdown](Namespace.md#shutdown) ## Constructors @@ -73,3 +74,19 @@ ___ #### Returns `void` + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/NamespaceError.md b/docs/api/classes/NamespaceError.md new file mode 100644 index 00000000..5e2b8f65 --- /dev/null +++ b/docs/api/classes/NamespaceError.md @@ -0,0 +1,161 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / NamespaceError + +# Class: NamespaceError + +## Hierarchy + +- `RedisSMQError` + + ↳ **`NamespaceError`** + + ↳↳ [`NamespaceNotFoundError`](NamespaceNotFoundError.md) + +## Table of contents + +### Constructors + +- [constructor](NamespaceError.md#constructor) + +### Properties + +- [cause](NamespaceError.md#cause) +- [message](NamespaceError.md#message) +- [stack](NamespaceError.md#stack) +- [prepareStackTrace](NamespaceError.md#preparestacktrace) +- [stackTraceLimit](NamespaceError.md#stacktracelimit) + +### Accessors + +- [name](NamespaceError.md#name) + +### Methods + +- [captureStackTrace](NamespaceError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new NamespaceError**(`message?`): [`NamespaceError`](NamespaceError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message?` | `string` | + +#### Returns + +[`NamespaceError`](NamespaceError.md) + +#### Inherited from + +RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/NamespaceNotFoundError.md b/docs/api/classes/NamespaceNotFoundError.md new file mode 100644 index 00000000..3121abab --- /dev/null +++ b/docs/api/classes/NamespaceNotFoundError.md @@ -0,0 +1,159 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / NamespaceNotFoundError + +# Class: NamespaceNotFoundError + +## Hierarchy + +- [`NamespaceError`](NamespaceError.md) + + ↳ **`NamespaceNotFoundError`** + +## Table of contents + +### Constructors + +- [constructor](NamespaceNotFoundError.md#constructor) + +### Properties + +- [cause](NamespaceNotFoundError.md#cause) +- [message](NamespaceNotFoundError.md#message) +- [stack](NamespaceNotFoundError.md#stack) +- [prepareStackTrace](NamespaceNotFoundError.md#preparestacktrace) +- [stackTraceLimit](NamespaceNotFoundError.md#stacktracelimit) + +### Accessors + +- [name](NamespaceNotFoundError.md#name) + +### Methods + +- [captureStackTrace](NamespaceNotFoundError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new NamespaceNotFoundError**(`namespace`): [`NamespaceNotFoundError`](NamespaceNotFoundError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `namespace` | `string` | + +#### Returns + +[`NamespaceNotFoundError`](NamespaceNotFoundError.md) + +#### Overrides + +[NamespaceError](NamespaceError.md).[constructor](NamespaceError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[NamespaceError](NamespaceError.md).[cause](NamespaceError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[NamespaceError](NamespaceError.md).[message](NamespaceError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[NamespaceError](NamespaceError.md).[stack](NamespaceError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[NamespaceError](NamespaceError.md).[prepareStackTrace](NamespaceError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[NamespaceError](NamespaceError.md).[stackTraceLimit](NamespaceError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +NamespaceError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[NamespaceError](NamespaceError.md).[captureStackTrace](NamespaceError.md#capturestacktrace) diff --git a/docs/api/classes/Producer.md b/docs/api/classes/Producer.md index a6ae40b3..7ec17e02 100644 --- a/docs/api/classes/Producer.md +++ b/docs/api/classes/Producer.md @@ -4,7 +4,7 @@ ## Hierarchy -- `Base` +- `Runnable`\<[`TProducerEvent`](../README.md#tproducerevent)\> ↳ **`Producer`** @@ -16,14 +16,18 @@ ### Methods +- [emit](Producer.md#emit) - [getId](Producer.md#getid) -- [handleError](Producer.md#handleerror) - [isDown](Producer.md#isdown) - [isGoingDown](Producer.md#isgoingdown) - [isGoingUp](Producer.md#isgoingup) - [isRunning](Producer.md#isrunning) - [isUp](Producer.md#isup) +- [on](Producer.md#on) +- [once](Producer.md#once) - [produce](Producer.md#produce) +- [removeAllListeners](Producer.md#removealllisteners) +- [removeListener](Producer.md#removelistener) - [run](Producer.md#run) - [shutdown](Producer.md#shutdown) @@ -37,43 +41,50 @@ [`Producer`](Producer.md) -#### Inherited from +#### Overrides -Base.constructor +Runnable\<TProducerEvent\>.constructor ## Methods -### getId +### emit -▸ **getId**(): `string` +▸ **emit**\<`E`\>(`event`, `...args`): `boolean` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TProducerEvent`](../README.md#tproducerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `...args` | `Parameters`\<[`TProducerEvent`](../README.md#tproducerevent)[`E`]\> | #### Returns -`string` +`boolean` #### Inherited from -Base.getId +Runnable.emit ___ -### handleError - -▸ **handleError**(`err`): `void` - -#### Parameters +### getId -| Name | Type | -| :------ | :------ | -| `err` | `Error` | +▸ **getId**(): `string` #### Returns -`void` +`string` #### Inherited from -Base.handleError +Runnable.getId ___ @@ -87,7 +98,7 @@ ___ #### Inherited from -Base.isDown +Runnable.isDown ___ @@ -101,7 +112,7 @@ ___ #### Inherited from -Base.isGoingDown +Runnable.isGoingDown ___ @@ -115,7 +126,7 @@ ___ #### Inherited from -Base.isGoingUp +Runnable.isGoingUp ___ @@ -129,7 +140,7 @@ ___ #### Inherited from -Base.isRunning +Runnable.isRunning ___ @@ -143,7 +154,61 @@ ___ #### Inherited from -Base.isUp +Runnable.isUp + +___ + +### on + +▸ **on**\<`E`\>(`event`, `listener`): [`Producer`](Producer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TProducerEvent`](../README.md#tproducerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TProducerEvent`](../README.md#tproducerevent)[`E`] | + +#### Returns + +[`Producer`](Producer.md) + +#### Inherited from + +Runnable.on + +___ + +### once + +▸ **once**\<`E`\>(`event`, `listener`): [`Producer`](Producer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TProducerEvent`](../README.md#tproducerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TProducerEvent`](../README.md#tproducerevent)[`E`] | + +#### Returns + +[`Producer`](Producer.md) + +#### Inherited from + +Runnable.once ___ @@ -164,15 +229,68 @@ ___ ___ +### removeAllListeners + +▸ **removeAllListeners**\<`E`\>(`event?`): [`Producer`](Producer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TProducerEvent`](../README.md#tproducerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event?` | `Extract`\<`E`, `string`\> | + +#### Returns + +[`Producer`](Producer.md) + +#### Inherited from + +Runnable.removeAllListeners + +___ + +### removeListener + +▸ **removeListener**\<`E`\>(`event`, `listener`): [`Producer`](Producer.md) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `E` | extends keyof [`TProducerEvent`](../README.md#tproducerevent) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | `E` | +| `listener` | [`TProducerEvent`](../README.md#tproducerevent)[`E`] | + +#### Returns + +[`Producer`](Producer.md) + +#### Inherited from + +Runnable.removeListener + +___ + ### run -▸ **run**(`cb?`): `void` +▸ **run**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb?` | `ICallback`\<`boolean`\> | +| `cb` | `ICallback`\<`boolean`\> | #### Returns @@ -180,19 +298,19 @@ ___ #### Inherited from -Base.run +Runnable.run ___ ### shutdown -▸ **shutdown**(`cb?`): `void` +▸ **shutdown**(`cb`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `cb?` | `ICallback`\<`boolean`\> | +| `cb` | `ICallback`\<`void`\> | #### Returns @@ -200,4 +318,4 @@ ___ #### Inherited from -Base.shutdown +Runnable.shutdown diff --git a/docs/api/classes/ProducerError.md b/docs/api/classes/ProducerError.md index de534b8a..b9a01e3e 100644 --- a/docs/api/classes/ProducerError.md +++ b/docs/api/classes/ProducerError.md @@ -24,6 +24,22 @@ - [constructor](ProducerError.md#constructor) +### Properties + +- [cause](ProducerError.md#cause) +- [message](ProducerError.md#message) +- [stack](ProducerError.md#stack) +- [prepareStackTrace](ProducerError.md#preparestacktrace) +- [stackTraceLimit](ProducerError.md#stacktracelimit) + +### Accessors + +- [name](ProducerError.md#name) + +### Methods + +- [captureStackTrace](ProducerError.md#capturestacktrace) + ## Constructors ### constructor @@ -43,3 +59,111 @@ #### Inherited from RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/ProducerInstanceNotRunningError.md b/docs/api/classes/ProducerInstanceNotRunningError.md index e888b035..ba6e91f9 100644 --- a/docs/api/classes/ProducerInstanceNotRunningError.md +++ b/docs/api/classes/ProducerInstanceNotRunningError.md @@ -14,6 +14,22 @@ - [constructor](ProducerInstanceNotRunningError.md#constructor) +### Properties + +- [cause](ProducerInstanceNotRunningError.md#cause) +- [message](ProducerInstanceNotRunningError.md#message) +- [stack](ProducerInstanceNotRunningError.md#stack) +- [prepareStackTrace](ProducerInstanceNotRunningError.md#preparestacktrace) +- [stackTraceLimit](ProducerInstanceNotRunningError.md#stacktracelimit) + +### Accessors + +- [name](ProducerInstanceNotRunningError.md#name) + +### Methods + +- [captureStackTrace](ProducerInstanceNotRunningError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Overrides [ProducerError](ProducerError.md).[constructor](ProducerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ProducerError](ProducerError.md).[cause](ProducerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[message](ProducerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[stack](ProducerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ProducerError](ProducerError.md).[prepareStackTrace](ProducerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ProducerError](ProducerError.md).[stackTraceLimit](ProducerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProducerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ProducerError](ProducerError.md).[captureStackTrace](ProducerError.md#capturestacktrace) diff --git a/docs/api/classes/ProducerMessageExchangeRequiredError.md b/docs/api/classes/ProducerMessageExchangeRequiredError.md index 04b31381..b7e1d666 100644 --- a/docs/api/classes/ProducerMessageExchangeRequiredError.md +++ b/docs/api/classes/ProducerMessageExchangeRequiredError.md @@ -14,6 +14,22 @@ - [constructor](ProducerMessageExchangeRequiredError.md#constructor) +### Properties + +- [cause](ProducerMessageExchangeRequiredError.md#cause) +- [message](ProducerMessageExchangeRequiredError.md#message) +- [stack](ProducerMessageExchangeRequiredError.md#stack) +- [prepareStackTrace](ProducerMessageExchangeRequiredError.md#preparestacktrace) +- [stackTraceLimit](ProducerMessageExchangeRequiredError.md#stacktracelimit) + +### Accessors + +- [name](ProducerMessageExchangeRequiredError.md#name) + +### Methods + +- [captureStackTrace](ProducerMessageExchangeRequiredError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ProducerError](ProducerError.md).[constructor](ProducerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ProducerError](ProducerError.md).[cause](ProducerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[message](ProducerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[stack](ProducerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ProducerError](ProducerError.md).[prepareStackTrace](ProducerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ProducerError](ProducerError.md).[stackTraceLimit](ProducerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProducerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ProducerError](ProducerError.md).[captureStackTrace](ProducerError.md#capturestacktrace) diff --git a/docs/api/classes/ProducerMessageNotPublishedError.md b/docs/api/classes/ProducerMessageNotPublishedError.md index 97fe80a6..57661d07 100644 --- a/docs/api/classes/ProducerMessageNotPublishedError.md +++ b/docs/api/classes/ProducerMessageNotPublishedError.md @@ -14,6 +14,22 @@ - [constructor](ProducerMessageNotPublishedError.md#constructor) +### Properties + +- [cause](ProducerMessageNotPublishedError.md#cause) +- [message](ProducerMessageNotPublishedError.md#message) +- [stack](ProducerMessageNotPublishedError.md#stack) +- [prepareStackTrace](ProducerMessageNotPublishedError.md#preparestacktrace) +- [stackTraceLimit](ProducerMessageNotPublishedError.md#stacktracelimit) + +### Accessors + +- [name](ProducerMessageNotPublishedError.md#name) + +### Methods + +- [captureStackTrace](ProducerMessageNotPublishedError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ProducerError](ProducerError.md).[constructor](ProducerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ProducerError](ProducerError.md).[cause](ProducerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[message](ProducerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[stack](ProducerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ProducerError](ProducerError.md).[prepareStackTrace](ProducerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ProducerError](ProducerError.md).[stackTraceLimit](ProducerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProducerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ProducerError](ProducerError.md).[captureStackTrace](ProducerError.md#capturestacktrace) diff --git a/docs/api/classes/ProducerMessageNotScheduledError.md b/docs/api/classes/ProducerMessageNotScheduledError.md index 4229f7b1..7fbddcdc 100644 --- a/docs/api/classes/ProducerMessageNotScheduledError.md +++ b/docs/api/classes/ProducerMessageNotScheduledError.md @@ -14,6 +14,22 @@ - [constructor](ProducerMessageNotScheduledError.md#constructor) +### Properties + +- [cause](ProducerMessageNotScheduledError.md#cause) +- [message](ProducerMessageNotScheduledError.md#message) +- [stack](ProducerMessageNotScheduledError.md#stack) +- [prepareStackTrace](ProducerMessageNotScheduledError.md#preparestacktrace) +- [stackTraceLimit](ProducerMessageNotScheduledError.md#stacktracelimit) + +### Accessors + +- [name](ProducerMessageNotScheduledError.md#name) + +### Methods + +- [captureStackTrace](ProducerMessageNotScheduledError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ProducerError](ProducerError.md).[constructor](ProducerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ProducerError](ProducerError.md).[cause](ProducerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[message](ProducerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[stack](ProducerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ProducerError](ProducerError.md).[prepareStackTrace](ProducerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ProducerError](ProducerError.md).[stackTraceLimit](ProducerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProducerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ProducerError](ProducerError.md).[captureStackTrace](ProducerError.md#capturestacktrace) diff --git a/docs/api/classes/ProducerQueueWithoutConsumerGroupsError.md b/docs/api/classes/ProducerQueueWithoutConsumerGroupsError.md index 52245f12..f4ec65b4 100644 --- a/docs/api/classes/ProducerQueueWithoutConsumerGroupsError.md +++ b/docs/api/classes/ProducerQueueWithoutConsumerGroupsError.md @@ -14,6 +14,22 @@ - [constructor](ProducerQueueWithoutConsumerGroupsError.md#constructor) +### Properties + +- [cause](ProducerQueueWithoutConsumerGroupsError.md#cause) +- [message](ProducerQueueWithoutConsumerGroupsError.md#message) +- [stack](ProducerQueueWithoutConsumerGroupsError.md#stack) +- [prepareStackTrace](ProducerQueueWithoutConsumerGroupsError.md#preparestacktrace) +- [stackTraceLimit](ProducerQueueWithoutConsumerGroupsError.md#stacktracelimit) + +### Accessors + +- [name](ProducerQueueWithoutConsumerGroupsError.md#name) + +### Methods + +- [captureStackTrace](ProducerQueueWithoutConsumerGroupsError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [ProducerError](ProducerError.md).[constructor](ProducerError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[ProducerError](ProducerError.md).[cause](ProducerError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[message](ProducerError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[ProducerError](ProducerError.md).[stack](ProducerError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[ProducerError](ProducerError.md).[prepareStackTrace](ProducerError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[ProducerError](ProducerError.md).[stackTraceLimit](ProducerError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +ProducerError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[ProducerError](ProducerError.md).[captureStackTrace](ProducerError.md#capturestacktrace) diff --git a/docs/api/classes/ProducibleMessage.md b/docs/api/classes/ProducibleMessage.md index e4fa8e53..9d699708 100644 --- a/docs/api/classes/ProducibleMessage.md +++ b/docs/api/classes/ProducibleMessage.md @@ -30,7 +30,6 @@ - [resetScheduledParams](ProducibleMessage.md#resetscheduledparams) - [setBody](ProducibleMessage.md#setbody) - [setConsumeTimeout](ProducibleMessage.md#setconsumetimeout) -- [setExchange](ProducibleMessage.md#setexchange) - [setFanOut](ProducibleMessage.md#setfanout) - [setPriority](ProducibleMessage.md#setpriority) - [setQueue](ProducibleMessage.md#setqueue) @@ -98,11 +97,11 @@ ___ ### getExchange -▸ **getExchange**(): ``null`` \| [`TExchange`](../README.md#texchange) +▸ **getExchange**(): ``null`` \| [`TExchangeTransferable`](../README.md#texchangetransferable) #### Returns -``null`` \| [`TExchange`](../README.md#texchange) +``null`` \| [`TExchangeTransferable`](../README.md#texchangetransferable) ___ @@ -128,11 +127,11 @@ ___ ### getQueue -▸ **getQueue**(): ``null`` \| `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) +▸ **getQueue**(): ``null`` \| [`IQueueParams`](../interfaces/IQueueParams.md) #### Returns -``null`` \| `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) +``null`` \| [`IQueueParams`](../interfaces/IQueueParams.md) ___ @@ -208,11 +207,11 @@ ___ ### getTopic -▸ **getTopic**(): ``null`` \| `string` \| [`TTopicParams`](../README.md#ttopicparams) +▸ **getTopic**(): ``null`` \| [`ITopicParams`](../interfaces/ITopicParams.md) #### Returns -``null`` \| `string` \| [`TTopicParams`](../README.md#ttopicparams) +``null`` \| [`ITopicParams`](../interfaces/ITopicParams.md) ___ @@ -268,22 +267,6 @@ ___ ___ -### setExchange - -▸ **setExchange**(`exchange`): [`ProducibleMessage`](ProducibleMessage.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `exchange` | [`TExchange`](../README.md#texchange) | - -#### Returns - -[`ProducibleMessage`](ProducibleMessage.md) - -___ - ### setFanOut ▸ **setFanOut**(`fanOutName`): [`ProducibleMessage`](ProducibleMessage.md) @@ -452,7 +435,7 @@ ___ | Name | Type | | :------ | :------ | -| `topicParams` | `string` \| [`TTopicParams`](../modules.md#ttopicparams) | +| `topicParams` | `string` \| [`ITopicParams`](../interfaces/ITopicParams.md) | #### Returns diff --git a/docs/api/classes/Queue.md b/docs/api/classes/Queue.md index 8bdfa3ec..fb266eca 100644 --- a/docs/api/classes/Queue.md +++ b/docs/api/classes/Queue.md @@ -15,6 +15,7 @@ - [getProperties](Queue.md#getproperties) - [getQueues](Queue.md#getqueues) - [save](Queue.md#save) +- [shutdown](Queue.md#shutdown) ## Constructors @@ -111,3 +112,19 @@ ___ #### Returns `void` + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/QueueAcknowledgedMessages.md b/docs/api/classes/QueueAcknowledgedMessages.md index 35e1c7db..7a81bac8 100644 --- a/docs/api/classes/QueueAcknowledgedMessages.md +++ b/docs/api/classes/QueueAcknowledgedMessages.md @@ -24,6 +24,7 @@ - [getMessages](QueueAcknowledgedMessages.md#getmessages) - [purge](QueueAcknowledgedMessages.md#purge) - [requeueMessage](QueueAcknowledgedMessages.md#requeuemessage) +- [shutdown](QueueAcknowledgedMessages.md#shutdown) ## Constructors @@ -125,3 +126,23 @@ ___ #### Implementation of [IQueueMessagesRequeuable](../interfaces/IQueueMessagesRequeuable.md).[requeueMessage](../interfaces/IQueueMessagesRequeuable.md#requeuemessage) + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` + +#### Inherited from + +QueueMessagesPaginatorList.shutdown diff --git a/docs/api/classes/QueueDeadLetteredMessages.md b/docs/api/classes/QueueDeadLetteredMessages.md index 7e7683f3..728f23fe 100644 --- a/docs/api/classes/QueueDeadLetteredMessages.md +++ b/docs/api/classes/QueueDeadLetteredMessages.md @@ -24,6 +24,7 @@ - [getMessages](QueueDeadLetteredMessages.md#getmessages) - [purge](QueueDeadLetteredMessages.md#purge) - [requeueMessage](QueueDeadLetteredMessages.md#requeuemessage) +- [shutdown](QueueDeadLetteredMessages.md#shutdown) ## Constructors @@ -125,3 +126,23 @@ ___ #### Implementation of [IQueueMessagesRequeuable](../interfaces/IQueueMessagesRequeuable.md).[requeueMessage](../interfaces/IQueueMessagesRequeuable.md#requeuemessage) + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` + +#### Inherited from + +QueueMessagesPaginatorList.shutdown diff --git a/docs/api/classes/QueueError.md b/docs/api/classes/QueueError.md index 8fe2a1aa..4988e9bb 100644 --- a/docs/api/classes/QueueError.md +++ b/docs/api/classes/QueueError.md @@ -8,10 +8,6 @@ ↳ **`QueueError`** - ↳↳ [`QueueMessageRequeueError`](QueueMessageRequeueError.md) - - ↳↳ [`QueueNamespaceNotFoundError`](QueueNamespaceNotFoundError.md) - ↳↳ [`QueueExistsError`](QueueExistsError.md) ↳↳ [`QueueHasRunningConsumersError`](QueueHasRunningConsumersError.md) @@ -20,14 +16,28 @@ ↳↳ [`QueueNotFoundError`](QueueNotFoundError.md) - ↳↳ [`QueueRateLimitError`](QueueRateLimitError.md) - ## Table of contents ### Constructors - [constructor](QueueError.md#constructor) +### Properties + +- [cause](QueueError.md#cause) +- [message](QueueError.md#message) +- [stack](QueueError.md#stack) +- [prepareStackTrace](QueueError.md#preparestacktrace) +- [stackTraceLimit](QueueError.md#stacktracelimit) + +### Accessors + +- [name](QueueError.md#name) + +### Methods + +- [captureStackTrace](QueueError.md#capturestacktrace) + ## Constructors ### constructor @@ -47,3 +57,111 @@ #### Inherited from RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/QueueExistsError.md b/docs/api/classes/QueueExistsError.md index 07775b58..e7968bd1 100644 --- a/docs/api/classes/QueueExistsError.md +++ b/docs/api/classes/QueueExistsError.md @@ -14,6 +14,22 @@ - [constructor](QueueExistsError.md#constructor) +### Properties + +- [cause](QueueExistsError.md#cause) +- [message](QueueExistsError.md#message) +- [stack](QueueExistsError.md#stack) +- [prepareStackTrace](QueueExistsError.md#preparestacktrace) +- [stackTraceLimit](QueueExistsError.md#stacktracelimit) + +### Accessors + +- [name](QueueExistsError.md#name) + +### Methods + +- [captureStackTrace](QueueExistsError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [QueueError](QueueError.md).[constructor](QueueError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[QueueError](QueueError.md).[cause](QueueError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[message](QueueError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[stack](QueueError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[QueueError](QueueError.md).[prepareStackTrace](QueueError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[QueueError](QueueError.md).[stackTraceLimit](QueueError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +QueueError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[QueueError](QueueError.md).[captureStackTrace](QueueError.md#capturestacktrace) diff --git a/docs/api/classes/QueueHasRunningConsumersError.md b/docs/api/classes/QueueHasRunningConsumersError.md index 9c2f75da..660673a2 100644 --- a/docs/api/classes/QueueHasRunningConsumersError.md +++ b/docs/api/classes/QueueHasRunningConsumersError.md @@ -14,6 +14,22 @@ - [constructor](QueueHasRunningConsumersError.md#constructor) +### Properties + +- [cause](QueueHasRunningConsumersError.md#cause) +- [message](QueueHasRunningConsumersError.md#message) +- [stack](QueueHasRunningConsumersError.md#stack) +- [prepareStackTrace](QueueHasRunningConsumersError.md#preparestacktrace) +- [stackTraceLimit](QueueHasRunningConsumersError.md#stacktracelimit) + +### Accessors + +- [name](QueueHasRunningConsumersError.md#name) + +### Methods + +- [captureStackTrace](QueueHasRunningConsumersError.md#capturestacktrace) + ## Constructors ### constructor @@ -27,3 +43,111 @@ #### Overrides [QueueError](QueueError.md).[constructor](QueueError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[QueueError](QueueError.md).[cause](QueueError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[message](QueueError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[stack](QueueError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[QueueError](QueueError.md).[prepareStackTrace](QueueError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[QueueError](QueueError.md).[stackTraceLimit](QueueError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +QueueError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[QueueError](QueueError.md).[captureStackTrace](QueueError.md#capturestacktrace) diff --git a/docs/api/classes/QueueMessageError.md b/docs/api/classes/QueueMessageError.md new file mode 100644 index 00000000..50839c07 --- /dev/null +++ b/docs/api/classes/QueueMessageError.md @@ -0,0 +1,161 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / QueueMessageError + +# Class: QueueMessageError + +## Hierarchy + +- `RedisSMQError` + + ↳ **`QueueMessageError`** + + ↳↳ [`MessageRequeueError`](MessageRequeueError.md) + +## Table of contents + +### Constructors + +- [constructor](QueueMessageError.md#constructor) + +### Properties + +- [cause](QueueMessageError.md#cause) +- [message](QueueMessageError.md#message) +- [stack](QueueMessageError.md#stack) +- [prepareStackTrace](QueueMessageError.md#preparestacktrace) +- [stackTraceLimit](QueueMessageError.md#stacktracelimit) + +### Accessors + +- [name](QueueMessageError.md#name) + +### Methods + +- [captureStackTrace](QueueMessageError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new QueueMessageError**(`message?`): [`QueueMessageError`](QueueMessageError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message?` | `string` | + +#### Returns + +[`QueueMessageError`](QueueMessageError.md) + +#### Inherited from + +RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/QueueMessageRequeueError.md b/docs/api/classes/QueueMessageRequeueError.md deleted file mode 100644 index f320ad96..00000000 --- a/docs/api/classes/QueueMessageRequeueError.md +++ /dev/null @@ -1,35 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / QueueMessageRequeueError - -# Class: QueueMessageRequeueError - -## Hierarchy - -- [`QueueError`](QueueError.md) - - ↳ **`QueueMessageRequeueError`** - -## Table of contents - -### Constructors - -- [constructor](QueueMessageRequeueError.md#constructor) - -## Constructors - -### constructor - -• **new QueueMessageRequeueError**(`msg?`): [`QueueMessageRequeueError`](QueueMessageRequeueError.md) - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `msg` | `string` | `'MESSAGE_REQUEUE_ERROR'` | - -#### Returns - -[`QueueMessageRequeueError`](QueueMessageRequeueError.md) - -#### Overrides - -[QueueError](QueueError.md).[constructor](QueueError.md#constructor) diff --git a/docs/api/classes/QueueMessages.md b/docs/api/classes/QueueMessages.md index e0b7b7ea..341c0175 100644 --- a/docs/api/classes/QueueMessages.md +++ b/docs/api/classes/QueueMessages.md @@ -20,6 +20,7 @@ - [countMessagesByStatus](QueueMessages.md#countmessagesbystatus) - [getMessages](QueueMessages.md#getmessages) - [purge](QueueMessages.md#purge) +- [shutdown](QueueMessages.md#shutdown) ## Constructors @@ -31,7 +32,7 @@ [`QueueMessages`](QueueMessages.md) -#### Inherited from +#### Overrides QueueMessagesPaginatorSet.constructor @@ -116,3 +117,23 @@ ___ #### Inherited from QueueMessagesPaginatorSet.purge + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` + +#### Overrides + +QueueMessagesPaginatorSet.shutdown diff --git a/docs/api/classes/QueueNamespaceNotFoundError.md b/docs/api/classes/QueueNamespaceNotFoundError.md deleted file mode 100644 index ff89daf6..00000000 --- a/docs/api/classes/QueueNamespaceNotFoundError.md +++ /dev/null @@ -1,35 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / QueueNamespaceNotFoundError - -# Class: QueueNamespaceNotFoundError - -## Hierarchy - -- [`QueueError`](QueueError.md) - - ↳ **`QueueNamespaceNotFoundError`** - -## Table of contents - -### Constructors - -- [constructor](QueueNamespaceNotFoundError.md#constructor) - -## Constructors - -### constructor - -• **new QueueNamespaceNotFoundError**(`namespace`): [`QueueNamespaceNotFoundError`](QueueNamespaceNotFoundError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `namespace` | `string` | - -#### Returns - -[`QueueNamespaceNotFoundError`](QueueNamespaceNotFoundError.md) - -#### Overrides - -[QueueError](QueueError.md).[constructor](QueueError.md#constructor) diff --git a/docs/api/classes/QueueNotEmptyError.md b/docs/api/classes/QueueNotEmptyError.md index 7a46e008..be284bbc 100644 --- a/docs/api/classes/QueueNotEmptyError.md +++ b/docs/api/classes/QueueNotEmptyError.md @@ -14,6 +14,22 @@ - [constructor](QueueNotEmptyError.md#constructor) +### Properties + +- [cause](QueueNotEmptyError.md#cause) +- [message](QueueNotEmptyError.md#message) +- [stack](QueueNotEmptyError.md#stack) +- [prepareStackTrace](QueueNotEmptyError.md#preparestacktrace) +- [stackTraceLimit](QueueNotEmptyError.md#stacktracelimit) + +### Accessors + +- [name](QueueNotEmptyError.md#name) + +### Methods + +- [captureStackTrace](QueueNotEmptyError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [QueueError](QueueError.md).[constructor](QueueError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[QueueError](QueueError.md).[cause](QueueError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[message](QueueError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[stack](QueueError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[QueueError](QueueError.md).[prepareStackTrace](QueueError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[QueueError](QueueError.md).[stackTraceLimit](QueueError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +QueueError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[QueueError](QueueError.md).[captureStackTrace](QueueError.md#capturestacktrace) diff --git a/docs/api/classes/QueueNotFoundError.md b/docs/api/classes/QueueNotFoundError.md index 208e812f..4cf43576 100644 --- a/docs/api/classes/QueueNotFoundError.md +++ b/docs/api/classes/QueueNotFoundError.md @@ -14,6 +14,22 @@ - [constructor](QueueNotFoundError.md#constructor) +### Properties + +- [cause](QueueNotFoundError.md#cause) +- [message](QueueNotFoundError.md#message) +- [stack](QueueNotFoundError.md#stack) +- [prepareStackTrace](QueueNotFoundError.md#preparestacktrace) +- [stackTraceLimit](QueueNotFoundError.md#stacktracelimit) + +### Accessors + +- [name](QueueNotFoundError.md#name) + +### Methods + +- [captureStackTrace](QueueNotFoundError.md#capturestacktrace) + ## Constructors ### constructor @@ -33,3 +49,111 @@ #### Inherited from [QueueError](QueueError.md).[constructor](QueueError.md#constructor) + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +[QueueError](QueueError.md).[cause](QueueError.md#cause) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[message](QueueError.md#message) + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[QueueError](QueueError.md).[stack](QueueError.md#stack) + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[QueueError](QueueError.md).[prepareStackTrace](QueueError.md#preparestacktrace) + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[QueueError](QueueError.md).[stackTraceLimit](QueueError.md#stacktracelimit) + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +QueueError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[QueueError](QueueError.md).[captureStackTrace](QueueError.md#capturestacktrace) diff --git a/docs/api/classes/QueuePendingMessages.md b/docs/api/classes/QueuePendingMessages.md index 291fe293..f181e477 100644 --- a/docs/api/classes/QueuePendingMessages.md +++ b/docs/api/classes/QueuePendingMessages.md @@ -17,6 +17,7 @@ - [countMessages](QueuePendingMessages.md#countmessages) - [getMessages](QueuePendingMessages.md#getmessages) - [purge](QueuePendingMessages.md#purge) +- [shutdown](QueuePendingMessages.md#shutdown) ## Constructors @@ -92,3 +93,19 @@ ___ #### Implementation of [IQueueMessages](../interfaces/IQueueMessages.md).[purge](../interfaces/IQueueMessages.md#purge) + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/QueueRateLimit.md b/docs/api/classes/QueueRateLimit.md index bd31a03b..46b37b20 100644 --- a/docs/api/classes/QueueRateLimit.md +++ b/docs/api/classes/QueueRateLimit.md @@ -14,6 +14,7 @@ - [get](QueueRateLimit.md#get) - [hasExceeded](QueueRateLimit.md#hasexceeded) - [set](QueueRateLimit.md#set) +- [shutdown](QueueRateLimit.md#shutdown) ## Constructors @@ -69,7 +70,7 @@ ___ | Name | Type | | :------ | :------ | -| `queue` | [`IQueueParams`](../interfaces/IQueueParams.md) | +| `queue` | `string` \| [`IQueueParams`](../interfaces/IQueueParams.md) | | `rateLimit` | [`IQueueRateLimit`](../interfaces/IQueueRateLimit.md) | | `cb` | `ICallback`\<`boolean`\> | @@ -94,3 +95,19 @@ ___ #### Returns `void` + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` diff --git a/docs/api/classes/QueueRateLimitError.md b/docs/api/classes/QueueRateLimitError.md index d7b0d8fc..20a4a0ea 100644 --- a/docs/api/classes/QueueRateLimitError.md +++ b/docs/api/classes/QueueRateLimitError.md @@ -4,7 +4,7 @@ ## Hierarchy -- [`QueueError`](QueueError.md) +- `RedisSMQError` ↳ **`QueueRateLimitError`** @@ -14,6 +14,22 @@ - [constructor](QueueRateLimitError.md#constructor) +### Properties + +- [cause](QueueRateLimitError.md#cause) +- [message](QueueRateLimitError.md#message) +- [stack](QueueRateLimitError.md#stack) +- [prepareStackTrace](QueueRateLimitError.md#preparestacktrace) +- [stackTraceLimit](QueueRateLimitError.md#stacktracelimit) + +### Accessors + +- [name](QueueRateLimitError.md#name) + +### Methods + +- [captureStackTrace](QueueRateLimitError.md#capturestacktrace) + ## Constructors ### constructor @@ -32,4 +48,112 @@ #### Inherited from -[QueueError](QueueError.md).[constructor](QueueError.md#constructor) +RedisSMQError.constructor + +## Properties + +### cause + +• `Optional` **cause**: `unknown` + +#### Inherited from + +RedisSMQError.cause + +___ + +### message + +• **message**: `string` + +#### Inherited from + +RedisSMQError.message + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +RedisSMQError.stack + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +RedisSMQError.prepareStackTrace + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +RedisSMQError.stackTraceLimit + +## Accessors + +### name + +• `get` **name**(): `string` + +#### Returns + +`string` + +#### Inherited from + +RedisSMQError.name + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +RedisSMQError.captureStackTrace diff --git a/docs/api/classes/QueueScheduledMessages.md b/docs/api/classes/QueueScheduledMessages.md index ee159664..f62f7d56 100644 --- a/docs/api/classes/QueueScheduledMessages.md +++ b/docs/api/classes/QueueScheduledMessages.md @@ -19,6 +19,7 @@ - [countMessages](QueueScheduledMessages.md#countmessages) - [getMessages](QueueScheduledMessages.md#getmessages) - [purge](QueueScheduledMessages.md#purge) +- [shutdown](QueueScheduledMessages.md#shutdown) ## Constructors @@ -98,3 +99,23 @@ ___ #### Inherited from QueueMessagesPaginatorSortedSet.purge + +___ + +### shutdown + +▸ **shutdown**(`cb`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cb` | `ICallback`\<`void`\> | + +#### Returns + +`void` + +#### Inherited from + +QueueMessagesPaginatorSortedSet.shutdown diff --git a/docs/api/enums/EWorkerThreadMessageCodeConsume.md b/docs/api/enums/EWorkerThreadMessageCodeConsume.md deleted file mode 100644 index 91246d69..00000000 --- a/docs/api/enums/EWorkerThreadMessageCodeConsume.md +++ /dev/null @@ -1,29 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EWorkerThreadMessageCodeConsume - -# Enumeration: EWorkerThreadMessageCodeConsume - -## Table of contents - -### Enumeration Members - -- [MESSAGE\_PROCESSING\_CAUGHT\_ERROR](EWorkerThreadMessageCodeConsume.md#message_processing_caught_error) -- [MESSAGE\_PROCESSING\_ERROR](EWorkerThreadMessageCodeConsume.md#message_processing_error) -- [OK](EWorkerThreadMessageCodeConsume.md#ok) - -## Enumeration Members - -### MESSAGE\_PROCESSING\_CAUGHT\_ERROR - -• **MESSAGE\_PROCESSING\_CAUGHT\_ERROR** = ``202`` - -___ - -### MESSAGE\_PROCESSING\_ERROR - -• **MESSAGE\_PROCESSING\_ERROR** = ``201`` - -___ - -### OK - -• **OK** = ``200`` diff --git a/docs/api/enums/EWorkerThreadMessageCodeExit.md b/docs/api/enums/EWorkerThreadMessageCodeExit.md deleted file mode 100644 index 749ad9d5..00000000 --- a/docs/api/enums/EWorkerThreadMessageCodeExit.md +++ /dev/null @@ -1,43 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / EWorkerThreadMessageCodeExit - -# Enumeration: EWorkerThreadMessageCodeExit - -## Table of contents - -### Enumeration Members - -- [HANDLER\_IMPORT\_ERROR](EWorkerThreadMessageCodeExit.md#handler_import_error) -- [INVALID\_HANDLER\_TYPE](EWorkerThreadMessageCodeExit.md#invalid_handler_type) -- [TERMINATED](EWorkerThreadMessageCodeExit.md#terminated) -- [UNCAUGHT\_EXCEPTION](EWorkerThreadMessageCodeExit.md#uncaught_exception) -- [WORKER\_DATA\_REQUIRED](EWorkerThreadMessageCodeExit.md#worker_data_required) - -## Enumeration Members - -### HANDLER\_IMPORT\_ERROR - -• **HANDLER\_IMPORT\_ERROR** = ``102`` - -___ - -### INVALID\_HANDLER\_TYPE - -• **INVALID\_HANDLER\_TYPE** = ``101`` - -___ - -### TERMINATED - -• **TERMINATED** = ``104`` - -___ - -### UNCAUGHT\_EXCEPTION - -• **UNCAUGHT\_EXCEPTION** = ``103`` - -___ - -### WORKER\_DATA\_REQUIRED - -• **WORKER\_DATA\_REQUIRED** = ``100`` diff --git a/docs/api/interfaces/IConsumerConfig.md b/docs/api/interfaces/IConsumerConfig.md new file mode 100644 index 00000000..f579a424 --- /dev/null +++ b/docs/api/interfaces/IConsumerConfig.md @@ -0,0 +1,15 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IConsumerConfig + +# Interface: IConsumerConfig + +## Table of contents + +### Properties + +- [enableMultiplexing](IConsumerConfig.md#enablemultiplexing) + +## Properties + +### enableMultiplexing + +• `Optional` **enableMultiplexing**: `boolean` diff --git a/docs/api/interfaces/IEventBusConfig.md b/docs/api/interfaces/IEventBusConfig.md new file mode 100644 index 00000000..ffc32141 --- /dev/null +++ b/docs/api/interfaces/IEventBusConfig.md @@ -0,0 +1,15 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IEventBusConfig + +# Interface: IEventBusConfig + +## Table of contents + +### Properties + +- [enabled](IEventBusConfig.md#enabled) + +## Properties + +### enabled + +• `Optional` **enabled**: `boolean` diff --git a/docs/api/interfaces/IEventListener.md b/docs/api/interfaces/IEventListener.md deleted file mode 100644 index 76c29981..00000000 --- a/docs/api/interfaces/IEventListener.md +++ /dev/null @@ -1,48 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IEventListener - -# Interface: IEventListener - -## Hierarchy - -- `EventEmitter`\<[`TRedisSMQEvent`](../README.md#tredissmqevent)\> - - ↳ **`IEventListener`** - -## Table of contents - -### Methods - -- [init](IEventListener.md#init) -- [quit](IEventListener.md#quit) - -## Methods - -### init - -▸ **init**(`cb`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | `ICallback`\<`void`\> | - -#### Returns - -`void` - -___ - -### quit - -▸ **quit**(`cb`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | `ICallback`\<`void`\> | - -#### Returns - -`void` diff --git a/docs/api/interfaces/IExchange.md b/docs/api/interfaces/IExchange.md index a491e6ae..f44a5fe4 100644 --- a/docs/api/interfaces/IExchange.md +++ b/docs/api/interfaces/IExchange.md @@ -1,96 +1,32 @@ [RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IExchange -# Interface: IExchange\ +# Interface: IExchange\ ## Type parameters -| Name | Type | -| :------ | :------ | -| `BindingParams` | `BindingParams` | -| `ExchangeType` | extends [`EExchangeType`](../enums/EExchangeType.md) | - -## Hierarchy - -- [`IExchangeSerialized`](IExchangeSerialized.md)\<`BindingParams`, `ExchangeType`\> - - ↳ **`IExchange`** +| Name | +| :------ | +| `ExchangeParams` | ## Table of contents -### Properties - -- [bindingParams](IExchange.md#bindingparams) -- [exchangeTag](IExchange.md#exchangetag) -- [type](IExchange.md#type) - ### Methods -- [getBindingParams](IExchange.md#getbindingparams) - [getQueues](IExchange.md#getqueues) -- [toJSON](IExchange.md#tojson) - -## Properties - -### bindingParams - -• `Readonly` **bindingParams**: `BindingParams` - -#### Inherited from - -[IExchangeSerialized](IExchangeSerialized.md).[bindingParams](IExchangeSerialized.md#bindingparams) - -___ - -### exchangeTag - -• `Readonly` **exchangeTag**: `string` - -#### Inherited from - -[IExchangeSerialized](IExchangeSerialized.md).[exchangeTag](IExchangeSerialized.md#exchangetag) - -___ - -### type - -• `Readonly` **type**: `ExchangeType` - -#### Inherited from - -[IExchangeSerialized](IExchangeSerialized.md).[type](IExchangeSerialized.md#type) ## Methods -### getBindingParams - -▸ **getBindingParams**(): `BindingParams` - -#### Returns - -`BindingParams` - -___ - ### getQueues -▸ **getQueues**(`cb`): `void` +▸ **getQueues**(`exchangeParams`, `cb`): `void` #### Parameters | Name | Type | | :------ | :------ | +| `exchangeParams` | `ExchangeParams` | | `cb` | `ICallback`\<[`IQueueParams`](IQueueParams.md)[]\> | #### Returns `void` - -___ - -### toJSON - -▸ **toJSON**(): [`IExchangeSerialized`](IExchangeSerialized.md)\<`BindingParams`, `ExchangeType`\> - -#### Returns - -[`IExchangeSerialized`](IExchangeSerialized.md)\<`BindingParams`, `ExchangeType`\> diff --git a/docs/api/interfaces/IExchangeSerialized.md b/docs/api/interfaces/IExchangeSerialized.md deleted file mode 100644 index dfceeaae..00000000 --- a/docs/api/interfaces/IExchangeSerialized.md +++ /dev/null @@ -1,42 +0,0 @@ -[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / IExchangeSerialized - -# Interface: IExchangeSerialized\ - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `BindingParams` | `BindingParams` | -| `ExchangeType` | extends [`EExchangeType`](../enums/EExchangeType.md) | - -## Hierarchy - -- **`IExchangeSerialized`** - - ↳ [`IExchange`](IExchange.md) - -## Table of contents - -### Properties - -- [bindingParams](IExchangeSerialized.md#bindingparams) -- [exchangeTag](IExchangeSerialized.md#exchangetag) -- [type](IExchangeSerialized.md#type) - -## Properties - -### bindingParams - -• `Readonly` **bindingParams**: `BindingParams` - -___ - -### exchangeTag - -• `Readonly` **exchangeTag**: `string` - -___ - -### type - -• `Readonly` **type**: `ExchangeType` diff --git a/docs/api/interfaces/IMessageParams.md b/docs/api/interfaces/IMessageParams.md index 2f939d31..ce9ac755 100644 --- a/docs/api/interfaces/IMessageParams.md +++ b/docs/api/interfaces/IMessageParams.md @@ -61,7 +61,7 @@ ___ ### exchange -• **exchange**: [`TExchangeSerialized`](../README.md#texchangeserialized) +• **exchange**: [`TExchangeTransferable`](../README.md#texchangetransferable) ___ diff --git a/docs/api/interfaces/IMessageTransferable.md b/docs/api/interfaces/IMessageTransferable.md index ca2d62a2..3515f8bd 100644 --- a/docs/api/interfaces/IMessageTransferable.md +++ b/docs/api/interfaces/IMessageTransferable.md @@ -84,7 +84,7 @@ ___ ### exchange -• **exchange**: [`TExchangeSerialized`](../README.md#texchangeserialized) +• **exchange**: [`TExchangeTransferable`](../README.md#texchangetransferable) #### Inherited from diff --git a/docs/api/interfaces/IRedisSMQConfig.md b/docs/api/interfaces/IRedisSMQConfig.md index e3df676a..e88e4c8e 100644 --- a/docs/api/interfaces/IRedisSMQConfig.md +++ b/docs/api/interfaces/IRedisSMQConfig.md @@ -6,7 +6,7 @@ ### Properties -- [eventListeners](IRedisSMQConfig.md#eventlisteners) +- [eventBus](IRedisSMQConfig.md#eventbus) - [logger](IRedisSMQConfig.md#logger) - [messages](IRedisSMQConfig.md#messages) - [namespace](IRedisSMQConfig.md#namespace) @@ -14,9 +14,9 @@ ## Properties -### eventListeners +### eventBus -• `Optional` **eventListeners**: [`TEventListenersConfig`](../README.md#teventlistenersconfig) +• `Optional` **eventBus**: [`IEventBusConfig`](IEventBusConfig.md) ___ diff --git a/docs/api/interfaces/IRedisSMQConfigRequired.md b/docs/api/interfaces/IRedisSMQConfigRequired.md index b1a37655..a2da02ab 100644 --- a/docs/api/interfaces/IRedisSMQConfigRequired.md +++ b/docs/api/interfaces/IRedisSMQConfigRequired.md @@ -12,7 +12,7 @@ ### Properties -- [eventListeners](IRedisSMQConfigRequired.md#eventlisteners) +- [eventBus](IRedisSMQConfigRequired.md#eventbus) - [logger](IRedisSMQConfigRequired.md#logger) - [messages](IRedisSMQConfigRequired.md#messages) - [namespace](IRedisSMQConfigRequired.md#namespace) @@ -20,15 +20,15 @@ ## Properties -### eventListeners +### eventBus -• **eventListeners**: [`TEventListenersConfig`](../README.md#teventlistenersconfig) +• **eventBus**: `Required`\<[`IEventBusConfig`](IEventBusConfig.md)\> #### Overrides -Required.eventListeners +Required.eventBus ---- +___ ### logger @@ -38,7 +38,7 @@ Required.eventListeners Required.logger ---- +___ ### messages @@ -46,16 +46,15 @@ Required.logger #### Type declaration - -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | +| Name | Type | +| :------ | :------ | | `store` | [`IMessagesConfigStorageRequired`](IMessagesConfigStorageRequired.md) | #### Overrides Required.messages ---- +___ ### namespace @@ -65,7 +64,7 @@ Required.messages Required.namespace ---- +___ ### redis diff --git a/docs/api/interfaces/ITopicParams.md b/docs/api/interfaces/ITopicParams.md new file mode 100644 index 00000000..0c9a8b58 --- /dev/null +++ b/docs/api/interfaces/ITopicParams.md @@ -0,0 +1,22 @@ +[RedisSMQ](../../../README.md) / [Docs](../../README.md) / [API Reference](../README.md) / ITopicParams + +# Interface: ITopicParams + +## Table of contents + +### Properties + +- [ns](ITopicParams.md#ns) +- [topic](ITopicParams.md#topic) + +## Properties + +### ns + +• **ns**: `string` + +___ + +### topic + +• **topic**: `string` diff --git a/docs/configuration.md b/docs/configuration.md index 09c75bb9..2290fdca 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -4,7 +4,7 @@ RedisSMQ configuration is a one-time setup that takes place, usually, during your application initialization and before using any exported class or function from the library. -To register a configuration object RedisSMQ provides a singleton class that may be used as shown bellow: +To set up the message queue RedisSMQ provides a singleton class that may be used as shown bellow: ```javascript 'use strict'; @@ -18,12 +18,12 @@ const config = { port: 6379, }, }, -} +}; Configuration.getSetConfig(config); ``` -See [Configuration Class Reference](api/classes/Configuration.md) for more details. +See [Configuration Reference](api/classes/Configuration.md) for more details. ## Configuration parameters @@ -36,31 +36,34 @@ See [IRedisSMQConfig Interface](api/interfaces/IRedisSMQConfig.md) for more deta const { ERedisConfigClient } = require('redis-smq'); module.exports = { - namespace: 'my_project_name', - redis: { - client: ERedisConfigClient.IOREDIS, - options: { - host: '127.0.0.1', - port: 6379, - connect_timeout: 3600000, - }, + namespace: 'my_project_name', + redis: { + client: ERedisConfigClient.IOREDIS, + options: { + host: '127.0.0.1', + port: 6379, + connect_timeout: 3600000, }, - logger: { - enabled: true, - options: { - level: 'info', - /* + }, + logger: { + enabled: true, + options: { + level: 'info', + /* streams: [ { path: path.normalize(`${__dirname}/../logs/redis-smq.log`) }, ], */ - }, - }, - messages: { - store: false, }, + }, + messages: { + store: false, + }, + eventBus: { + enabled: false, + } }; ``` @@ -83,9 +86,9 @@ const config = { messages: { store: { deadLettered: true, - } - } -} + }, + }, +}; ``` - Storing acknowledged messages without any limitation, and storing 100000 dead-lettered messages for a maximum retention time of 1 day: @@ -97,11 +100,11 @@ const config = { acknowledged: true, deadLettered: { queueSize: 100000, - expire: 24 * 60 * 60 * 1000 // 1 day in millis + expire: 24 * 60 * 60 * 1000, // 1 day in millis }, - } - } -} + }, + }, +}; ``` - Storing acknowledged messages up to 5000 messages, and storing a maximum of 5000 dead-lettered messages with a retention time of 1 day: @@ -115,9 +118,9 @@ const config = { }, deadLettered: { queueSize: 5000, - expire: 24 * 60 * 60 * 1000 + expire: 24 * 60 * 60 * 1000, }, - } - } -} + }, + }, +}; ``` diff --git a/docs/consuming-messages.md b/docs/consuming-messages.md index b0388dc6..87900a2a 100644 --- a/docs/consuming-messages.md +++ b/docs/consuming-messages.md @@ -25,12 +25,12 @@ const { Consumer } = require('redis-smq'); const consumer = new Consumer(); const messageHandler = (msg, cb) => { - console.log('Message payload', msg.body); - cb(); // acknowledging the message + console.log('Message payload', msg.body); + cb(); // acknowledging the message }; consumer.consume('test_queue', messageHandler, (err) => { - if (err) console.error(err); + if (err) console.error(err); }); consumer.run((err) => { @@ -75,6 +75,6 @@ Delivered messages that couldn't be processed or can not be delivered to consume By default, RedisSMQ does not store acknowledged and dead-lettered messages for saving disk and memory spaces, and also to increase message processing performance. -If you need such feature, you can enable it from your [configuration](configuration.md) object. +If you need such feature, you can enabled it from your [configuration](configuration.md) object. See [Consumer Class](api/classes/Consumer.md) for more details. diff --git a/docs/esm-cjs-modules.md b/docs/esm-cjs-modules.md index 1a48ab6e..ae393283 100644 --- a/docs/esm-cjs-modules.md +++ b/docs/esm-cjs-modules.md @@ -9,21 +9,15 @@ RedisSMQ packages are distributed in both ESM & CJS formats to allow developers ## Using RedisSMQ as an ESM Module ```javascript -import { Queue, EQueueType } from 'redis-smq'; +import { Queue } from 'redis-smq'; const queue = new Queue(); - -// Creating a LIFO queue -queue.save('my_queue', EQueueType.LIFO_QUEUE, (err) => console.error(err)); ``` ## Using RedisSMQ as a CJS Module ```javascript -const { Queue, EQueueType } = require('redis-smq'); +const { Queue } = require('redis-smq'); const queue = new Queue(); - -// Creating a LIFO queue -queue.save('my_queue', EQueueType.LIFO_QUEUE, (err) => console.error(err)); ``` diff --git a/docs/event-bus.md b/docs/event-bus.md new file mode 100644 index 00000000..4a52cf2a --- /dev/null +++ b/docs/event-bus.md @@ -0,0 +1,66 @@ +[RedisSMQ](../README.md) / [Docs](README.md) / EventBus + +# EventBus + +RedisSMQ EventBus allows your applications to subscribe to different system events in a PubSub style. + +By default, most of RedisSMQ events are not published to the EventBus. To use the EventBus you need first to enable it from your [RedisSMQ Configuration](configuration.md). + +See [EventBusRedisInstance API](api/classes/EventBusRedisInstance.md) for more details. + +## EventBus Events + +- [TConsumerEvent](api/README.md#tconsumerevent) +- [TConsumerHeartbeatEvent](api/README.md#tconsumerheartbeatevent) +- [TConsumerMessageHandlerRunnerEvent](api/README.md#tconsumermessagehandlerrunnerevent) +- [TConsumerMessageHandlerEvent](api/README.md#tconsumermessagehandlerevent) +- [TConsumerConsumeMessageEvent](api/README.md#tconsumerconsumemessageevent) +- [TConsumerDequeueMessageEvent](api/README.md#tconsumerdequeuemessageevent) +- [TProducerEvent](api/README.md#tproducerevent) +- [TQueueEvent](api/README.md#tqueueevent) + +## Usage + +### Configuration + +```typescript +const { Configuration } = require('redis-smq'); + +const config = { + eventBus: { + enabled: true, + } +} + +Configuration.getSetConfig(config); +``` + +See [RedisSMQ Configuration](configuration.md) for more details. + +### Creating an EventBus Instance + +```typescript +import { EventBusRedisInstance } from 'redis-smq'; + +EventBusRedisInstance.getSetInstance((err, eventBus) => { + // +}); +``` + +### Subscribing to Events + +In the example bellow we are going to subscribe to a [TConsumerConsumeMessageEvent](api/README.md#tconsumerconsumemessageevent) event. + +```typescript +eventBus.on('consumer.consumeMessage.messageAcknowledged', (messageId, queue, messageHandlerId, consumerId) => { + //... +}) +``` + +### Shutting Down the Eventbus Instance + +```typescript +EventBusRedisInstance.shutDown((err) => { + // +}); +``` diff --git a/docs/event-listeners.md b/docs/event-listeners.md deleted file mode 100644 index 97205277..00000000 --- a/docs/event-listeners.md +++ /dev/null @@ -1,77 +0,0 @@ -[RedisSMQ](../README.md) / [Docs](README.md) / Event listeners - -# Event listeners - -Event listeners is a way to automate processing every event from each consumer or producer instance. - -Let's suppose that for some reason you want to catch all `messageAcknowledged` events from all created consumer instances in your application. - -There are many ways to take in order to achieve this goal. The most repetitive and error prone way is to manually register an event listener after creating each consumer instance like this way: - -```javascript -const consumer = new Consumer(); -consumer.on('messageAcknowledged', (messageId, queue, messageHandlerId, consumerId) => { - //... -}) -``` - -A more convenient way to do the same thing but with less manual work is to configure RedisSMQ to initialize and manage event listeners for you. - -## Usage - -### Creating Event Listeners - -Let's create an event listener class which we will use to demonstrate how to work with event listeners. - -```typescript -import { IEventListener, TRedisSMQEvent } from 'redis-smq'; -import { ICallback, EventEmitter } from "redis-smq-common"; - -class MyEventListener extends EventEmitter implements IEventListener { - init(cb: ICallback) { - this.on('messageAcknowledged', (messageId, queue, messageHandlerId, consumerId) => { - //... - }) - } - - quit(cb: ICallback) { - // Clean up before quiting - // ... - } -} -``` - -Each time you create a Consumer or Producer instance, under the hood, RedisSMQ initializes the provided event listeners and manages them until the instance is destroyed. - -An event listener implements the [`IEventListener`](api/interfaces/IEventListener.md) interface. - -The [`init()`](api/interfaces/IEventListener.md#init) is intended to perform any initialization steps that your event listener may need. - -The [`quit()`](api/interfaces/IEventListener.md#quit) method is required to gracefully shut down your event listener instance when a consumer/producer goes down. - -### Registering Event Listeners - -Using a configuration object, RedisSMQ allows you to register one or many event listener classes as shown in the example bellow: - -```typescript -import { IConfig, Configuration } from 'redis-smq'; - -const config: IConfig = { - eventListeners: [MyEventListener] -} - -Configuration.getSetConfig(config); -``` - -See [`IRedisSMQConfig`](api/interfaces/IRedisSMQConfig.md) for more details. - -### Events - -An event listener allows subscribing to the following events: - -- `messagePublished` -- `messageAcknowledged` -- `messageUnacknowledged` -- `messageDeadLettered` - -See [TRedisSMQEvent](api/README.md#tredissmqevent) for more details. diff --git a/docs/exchanges-and-delivery-models.md b/docs/exchanges-and-delivery-models.md index 6fe5c2d2..f59d26ef 100644 --- a/docs/exchanges-and-delivery-models.md +++ b/docs/exchanges-and-delivery-models.md @@ -6,7 +6,7 @@ [Message Exchanges](message-exchanges.md) should not be confused with [Queue Delivery Models](queue-delivery-models.md). -Message exchanges allow publishing a message to one or many queues based on the message exchange. +Message exchanges allow publishing a message to one or many queues based on the message exchange. On the other hand, delivery models allow delivering a message to one consumer or to all consumers of a given queue. diff --git a/docs/message-exchanges.md b/docs/message-exchanges.md index bd5cdc3c..6f1d39a2 100644 --- a/docs/message-exchanges.md +++ b/docs/message-exchanges.md @@ -12,11 +12,11 @@ Each message is required to have a `message exchange` which is used by the produ From then, the producer **directly** publishes the message to the matched queues. -When a message is published to multiple queues, for each queue a new message is created with the same properties as the base message but with a new ID. +When a message is published to multiple queues, for each queue a new message is created with the same properties as the base message but with a new ID. -For a given message exchange, all messages that were created and published to multiple queues have the same `exchange tag`. +For a given message exchange, all messages that were created and published to multiple queues have the same `Exchange Tag`. -An `exchange tag` is a unique string property that identifies an exchange instance and, it is used to keep track of published messages originating from the same exchange instance. +An `Exchange tag` is a unique string property that is used to keep track of all messages that was published to the list of matched queues at the time when published a message. Out-of-box RedisSMQ offers 3 exchange types. @@ -26,7 +26,7 @@ Out-of-box RedisSMQ offers 3 exchange types. A direct exchange allows producers to publish a message to a single queue which is matched exactly by the specified queue of the exchange. -The queue of the direct exchange may be a string, like `a.b.c.d` or an object describing the namespace of the queue like `{ ns: 'my-app', name: 'a.b.c.d'}`. +The queue of the direct exchange may be a string, like `a.b.c.d` or an object describing the namespace of the queue like `{ ns: 'my-app', name: 'a.b.c.d'}`. If a string is used for the direct exchange queue then the **default** namespace will be used. @@ -34,24 +34,23 @@ A direct exchange with the queue `a.b.c.d` matches exactly the queue with the na ### Usage -The [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides: - -- [ProducibleMessage.setQueue()](api/classes/ProducibleMessage.md#setqueue): to set up a queue for the message. Under the hood, a new `ExchangeDirect` instance will be created and used for the message exchange. -- [ProducibleMessage.setExchange()](api/classes/ProducibleMessage.md#setexchange): to set a `ExchangeDirect` instance which you have manually created. +To set up a Direct exchange (a queue) for a given message the [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides [ProducibleMessage.setQueue()](api/classes/ProducibleMessage.md#setqueue). ```typescript -const { ProducibleMessage, ExchangeDirect } = require("redis-smq"); +const { ProducibleMessage } = require('redis-smq'); const msg = new ProducibleMessage(); msg.setQueue('a.b.c.d').setBody('123456789'); - -// the same as -const exchange = new ExchangeDirect('a.b.c.d'); -msg.setExchange(exchange).setBody('123456789'); ``` When publishing a message with a direct exchange, if the exchange queue does not exist the message will be discarded and an error will be returned. +To get the list of matched queues for a given message with a direct exchange use [ExchangeDirect.getQueues()](api/classes/ExchangeDirect.md#getqueues). + +For more details see: + +- [ExchangeDirect Class](api/classes/ExchangeDirect.md) + ## Topic Exchange ![RedisSMQ Topic Exchange](redis-smq-topic-exchange.png) @@ -62,7 +61,7 @@ The pattern of a topic exchange is a string which is composed of alphanumeric ch The `a.b.c.d` topic pattern matches the following queues `a.b.c.d`, `a.b.c.d.e`, and `a.b.c.d.e.f`, but it does not match the `a.b`, `a.b.c`, or `a.b.c.z` queues. -A topic pattern may be also an object describing the namespace of the topic. +A topic pattern may be also an object describing the namespace of the topic. For example the topic `{ ns: 'my-app', topic: 'a.b.c.d'}` will match all queues which satisfy the pattern `a.b.c.d` from the namespace `my-app`. @@ -70,24 +69,23 @@ When a namespace is not provided the default namespace will be used. ### Usage -The [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides: - -- [ProducibleMessage.setTopic()](api/classes/ProducibleMessage.md#settopic): to set up a topic for the message. Under the hood, a new `ExchangeTopic` instance will be created and used for the message exchange. -- [ProducibleMessage.setExchange()](api/classes/ProducibleMessage.md#setexchange): to set a `ExchangeTopic` instance which you have manually created. +To set up a Topic exchange (a topic) for a given message the [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides [ProducibleMessage.setTopic()](api/classes/ProducibleMessage.md#settopic). ```typescript -const { ProducibleMessage, ExchangeTopic } = require("redis-smq"); +const { ProducibleMessage } = require('redis-smq'); const msg = new ProducibleMessage(); msg.setTopic('a.b.c.d').setBody('123456789'); - -// the same as -const exchange = new ExchangeTopic('a.b.c.d'); -msg.setExchange(exchange).setBody('123456789'); ``` When publishing a message with a topic exchange, if the topic pattern does not match any queues the message will be discarded and an error will be returned. +To get the list of matched queues for a given message with a Topic exchange use [ExchangeTopic.getQueues()](api/classes/ExchangeTopic.md#getqueues). + +For more details see: + +- [ExchangeTopic Class](api/classes/ExchangeTopic.md) + ## FanOut Exchange ![RedisSMQ FanOut Exchange](redis-smq-fanout-exchange.png) @@ -96,33 +94,25 @@ A FanOut exchange allows producers to publish a message to one or multiple queue ### Usage -In order to use a FanOut exchange you need first to create it and bind the selected queues to the exchange. - -The [ExchangeFanOut Class](api/classes/ExchangeFanOut.md) provides: +In order to use a FanOut exchange you need first to create it using [ExchangeFanOut.saveExchange()](api/classes/ExchangeFanOut.md#saveexchange) and bind one or many queues to the created exchange using [ExchangeFanOut.bindQueue()](api/classes/ExchangeFanOut.md#bindqueue). -- [ExchangeFanOut.bindQueue()](api/classes/ExchangeFanOut.md#bindqueue): To bind an existing queue to a FanOut exchange. -- [ExchangeFanOut.unbindQueue()](api/classes/ExchangeFanOut.md#unbindqueue): To unbind a queue from a FanOut exchange. -- [ExchangeFanOut.getQueueExchange()](api/classes/ExchangeFanOut.md#getqueueexchange): To retrieve the FanOut exchange to which a queue is bound. -- [ExchangeFanOut.getQueues()](api/classes/ExchangeFanOut.md#getqueues): To get the list of queues that are bound to a given FanOut exchange. - -The [ProducibleMessage API](api/classes/ProducibleMessage.md) provides: - -- [ProducibleMessage.setFanOut()](api/classes/ProducibleMessage.md#setfanout): to set up a FanOut exchange for the message. Under the hood, a new `ExchangeFanOut` instance will be created and used for the message exchange. -- [ProducibleMessage.setExchange()](api/classes/ProducibleMessage.md#setexchange): to set a `ExchangeFanOut` instance which you have manually created. +To set up a FanOut exchange for a given message the [ProducibleMessage API](api/classes/ProducibleMessage.md) provides [ProducibleMessage.setFanOut()](api/classes/ProducibleMessage.md#setfanout). ```typescript -const { ProducibleMessage, ExchangeFanOut } = require("redis-smq"); - -// Assuming that my-FanOut-exchange already exists +const { ProducibleMessage } = require('redis-smq'); const msg = new ProducibleMessage(); -msg.setFanOut('my-FanOut-exchange').setBody('123456789'); -// the same as -const exchange = new ExchangeFanOut('my-FanOut-exchange'); -msg.setExchange(exchange).setBody('123456789'); +// Assuming that my-FanOut-exchange already exists +msg.setFanOut('my-FanOut-exchange').setBody('123456789'); ``` When publishing a message with a FanOut exchange, if the exchange does not exist or no queues are bound to such an exchange the message will be discarded and error will be returned. +To get the list of matched queues for a given message with a FanOut exchange use [ExchangeFanOut.getQueues()](api/classes/ExchangeFanOut.md#getqueues). + Additionally, FanOut exchanges can be also managed using the [HTTP API Interface](https://github.com/weyoss/redis-smq-monitor) or from your browser with the help of the [Web UI](https://github.com/weyoss/redis-smq-monitor-client). + +For more details see: + +- [ExchangeFanOut Class](api/classes/ExchangeFanOut.md) \ No newline at end of file diff --git a/docs/message-handler-worker-threads.md b/docs/message-handler-worker-threads.md index cad9a684..e3f92c57 100644 --- a/docs/message-handler-worker-threads.md +++ b/docs/message-handler-worker-threads.md @@ -30,7 +30,7 @@ Running a message handler in a separate thread is really useful, as already ment module.exports = function myHandler(msg, cb) { console.log(msg.body); // Perform here any heavy operation -} +}; ``` #### Consuming Messages @@ -41,8 +41,13 @@ const path = require('path'); const { Consumer } = require('redis-smq'); const consumer = new Consumer(); -const messageHandlerFilename = path.resolve(__dirname, './my/application/path/message-handlers/my-handler.js') -consumer.consume('my_queue', messageHandlerFilename, (err) => console.error(err)); +const messageHandlerFilename = path.resolve( + __dirname, + './my/application/path/message-handlers/my-handler.js', +); +consumer.consume('my_queue', messageHandlerFilename, (err) => + console.error(err), +); consumer.run((err) => { if (err) console.error(err); diff --git a/docs/messages.md b/docs/messages.md index 53e62a03..dbe41a98 100644 --- a/docs/messages.md +++ b/docs/messages.md @@ -10,9 +10,7 @@ The message payload can be of any valid JSON data type. It may be a simple text const { ProducibleMessage } = require('redis-smq'); const msg = new ProducibleMessage(); -msg.setBody({hello: 'world'}) - .setTTL(3600000) - .setRetryThreshold(5); +msg.setBody({ hello: 'world' }).setTTL(3600000).setRetryThreshold(5); ``` The `ProducibleMessage` class provides many methods for setting up different delivery/consumption parameters such as message priority, message TTL, retry threshold, etc. diff --git a/docs/multiplexing.md b/docs/multiplexing.md index 216f7179..84ab8de6 100644 --- a/docs/multiplexing.md +++ b/docs/multiplexing.md @@ -9,7 +9,7 @@ In normal operation mode, each message handler creates and uses its own redis co On the other hand, multiplexing allows many message handlers to share a single Redis connection. While this may sound counterproductive, it gives your applications some obvious advantages. -One of them is that consumers using multiplexing can handle a large number of message queues without creating a significant load on your system. The number of Redis connections does not grow linearly as the number of queues grows, and it is reduced to only one shared connection for all your message handlers. +One of them is that consumers using multiplexing can handle a large number of message queues without creating a significant load on your system. The number of Redis connections does not grow linearly as the number of queues grows, and it is reduced to only one shared connection for all your message handlers. Multiplexing does not come without a cost. Here are some of its disadvantages: @@ -20,7 +20,7 @@ So, before deciding whether to use multiplexing, it is important to know what yo ## Enabling multiplexing -Use the [Consumer Class Constructor](api/classes/Consumer.md#constructor) first argument to enable multiplexing: +Use the [Consumer Class Constructor](api/classes/Consumer.md#constructor) first argument to enabled multiplexing: ```javascript const consumer = new Consumer(true); @@ -29,23 +29,21 @@ const consumer = new Consumer(true); Once created, you can your consumer instance can be used as usually: ```javascript -consumer.consume('queue1', messageHandler1, (e) => { - //... +consumer.consume('queue1', messageHandler1, (e) => { + //... }); consumer.consume('queue2', messageHandler2, (e) => { - //... + //... }); consumer.consume('queue3', messageHandler3, (e) => { - //... + //... }); consumer.consume('queue4', messageHandler4, (e) => { - //... + //... }); ``` -As noted above, you should use multiplexing only when you really have a large number of queues, and you want to optimize your system resources. Otherwise, you should not enable it. - - +As noted above, you should use multiplexing only when you really have a large number of queues, and you want to optimize your system resources. Otherwise, you should not enabled it. diff --git a/docs/performance.md b/docs/performance.md index 07d6841a..f6a89fe6 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -1,11 +1,9 @@ [RedisSMQ](../README.md) / [Docs](README.md) / Performance - # Performance > Out-of-box RedisSMQ is optimized for performance. But if you are using a custom configuration, you should consider disabling the following features, in your production environment: logging, monitor server, storing acknowledged & dead-lettered messages. - ## Scenarios One key indicator about how RedisSMQ is fast and performant is Message throughput. Message throughput is the number of messages per second that the message queue can process. @@ -31,7 +29,7 @@ All consumers/producers instances and Redis server are launched from the same ho ## Results | Scenario | Producer rate (msg/sec) | Consumer rate (msg/sec) | -|-----------------------------------------------------|-------------------------|-------------------------| +| --------------------------------------------------- | ----------------------- | ----------------------- | | Run 1 producer instance | 23K+ | 0 | | Run 10 producer instances | 96K+ | 0 | | Run 1 consumer instance | 0 | 13K+ | diff --git a/docs/producing-messages.md b/docs/producing-messages.md index 71a5e16a..d39ccd2d 100644 --- a/docs/producing-messages.md +++ b/docs/producing-messages.md @@ -6,30 +6,32 @@ A `Producer` instance allows to publish a message to a queue. You can use a single `Producer` instance to produce messages, including messages with priority, to one or multiple queues. -Before publishing a message do not forget to set an exchange for the message using [ProducibleMessage.setQueue()](api/classes/ProducibleMessage.md#setqueue), [setTopic()](api/classes/ProducibleMessage.md#settopic), or [setFanOut()](api/classes/ProducibleMessage.md#setfanout). Otherwise, an error will be returned. - -See [Message Exchanges](message-exchanges.md) for more details. +Before publishing a message do not forget to set an exchange for the message using [ProducibleMessage.setQueue()](api/classes/ProducibleMessage.md#setqueue), [ProducibleMessage.setTopic()](api/classes/ProducibleMessage.md#settopic), or [ProducibleMessage.setFanOut()](api/classes/ProducibleMessage.md#setfanout). Otherwise, an error will be returned. ```javascript 'use strict'; -const {ProducibleMessage, Producer} = require('redis-smq'); +const { ProducibleMessage, Producer } = require('redis-smq'); const producer = new Producer(); // Always run the producer before producing a message producer.run((err) => { - if (err) console.error(err); - else { - const msg = new ProducibleMessage(); - msg.setBody({ hello: 'world' }) - .setTTL(3600000) // message expiration (in millis) - .setQueue('test_queue'); // setting up a direct exchange - producer.produce(msg, (err, reply) => { - if (err) console.error(err); - else console.log('Successfully produced'); - }); - } -}) + if (err) console.error(err); + else { + const msg = new ProducibleMessage(); + msg + .setBody({ hello: 'world' }) + .setTTL(3600000) // message expiration (in millis) + .setQueue('test_queue'); // setting up a direct exchange + producer.produce(msg, (err, reply) => { + if (err) console.error(err); + else console.log('Successfully produced'); + }); + } +}); ``` -See [Producer Class](api/classes/Producer.md) for more details. +For more details see: + +- [Message Exchanges](message-exchanges.md) +- [Producer Class](api/classes/Producer.md) diff --git a/docs/queue-delivery-models.md b/docs/queue-delivery-models.md index 7f95646b..3a02c2dc 100644 --- a/docs/queue-delivery-models.md +++ b/docs/queue-delivery-models.md @@ -16,10 +16,15 @@ In the Point-2-Point model, a message is produced to a Point-2-Point queue and t const { Queue, EQueueDeliveryModel, EQueueType } = require('redis-smq'); const queue = new Queue(); -queue.save('my-queue', EQueueType.LIFO_QUEUE, EQueueDeliveryModel.POINT_TO_POINT, (err, reply) => { - if (err) console.error(err); - else console.log('Successfully created', reply) -}) +queue.save( + 'my-queue', + EQueueType.LIFO_QUEUE, + EQueueDeliveryModel.POINT_TO_POINT, + (err, reply) => { + if (err) console.error(err); + else console.log('Successfully created', reply); + }, +); ``` See [Queue.save()](api/classes/Queue.md#save) for more details. @@ -35,11 +40,12 @@ message.setBody('hello world').setQueue('my-queue'); const producer = new Producer(); producer.run((err) => { if (err) console.error(err); - else producer.produce(message, (err, reply) => { - if (err) console.error(err); - else console.log('Successfully produced', reply); - }) -}) + else + producer.produce(message, (err, reply) => { + if (err) console.error(err); + else console.log('Successfully produced', reply); + }); +}); ``` See [Producer.produce()](api/classes/Producer.md#produce) for more details. @@ -58,7 +64,7 @@ consumer.consume('my-queue', messageHandler, (err) => { }); consumer.run((err) => { if (err) console.error(err); -}) +}); ``` ## Pub/Sub Delivery Model @@ -93,10 +99,15 @@ When `retryTreshold` is exceeded failed messages from all consumer groups are st const { Queue, EQueueDeliveryModel, EQueueType } = require('redis-smq'); const queue = new Queue(); -queue.save('my-pubsub-queue', EQueueType.LIFO_QUEUE, EQueueDeliveryModel.PUB_SUB, (err, reply) => { - if (err) console.error(err); - else console.log('Successfully created', reply) -}) +queue.save( + 'my-pubsub-queue', + EQueueType.LIFO_QUEUE, + EQueueDeliveryModel.PUB_SUB, + (err, reply) => { + if (err) console.error(err); + else console.log('Successfully created', reply); + }, +); ``` See [Queue.save()](api/classes/Queue.md#save) for more details. @@ -120,14 +131,15 @@ message.setBody('hello world').setQueue('my-pubsub-queue'); const producer = new Producer(); producer.run((err) => { if (err) console.error(err); - else producer.produce(message, (err, reply) => { - if (err) console.error(err); - else console.log('Successfully produced', reply); - }) -}) + else + producer.produce(message, (err, reply) => { + if (err) console.error(err); + else console.log('Successfully produced', reply); + }); +}); ``` -When producing a message to a Pub/Sub queue, if the queue has no consumer groups an error will be returned. +When producing a message to a Pub/Sub queue, if the queue has no consumer groups an error will be returned. So make sure the queue has at least one consumer group before publishing messages. @@ -141,13 +153,17 @@ const { Consumer } = require('redis-smq'); const consumer = new Consumer(); const messageHandler = (msg, cb) => cb(); // acknowledging -consumer.consume({ queue: 'my-pubsub-queue', groupId: 'my-app-group-1' }, messageHandler, (err) => { - if (err) console.error(err); - else console.log('MessageHandler added'); -}); +consumer.consume( + { queue: 'my-pubsub-queue', groupId: 'my-app-group-1' }, + messageHandler, + (err) => { + if (err) console.error(err); + else console.log('MessageHandler added'); + }, +); consumer.run((err) => { if (err) console.error(err); -}) +}); ``` Please do not forget to provide the consumer group ID when consuming messages from a Pub/Sub queue. diff --git a/docs/queue-rate-limiting.md b/docs/queue-rate-limiting.md index fc80d042..cfc277c8 100644 --- a/docs/queue-rate-limiting.md +++ b/docs/queue-rate-limiting.md @@ -11,12 +11,6 @@ In some cases consuming messages with a high message rate may be not desirable. RedisSMQ allows you, in such cases, to control the rate at which the messages are consumed by setting a rate limit for a given queue. -To configure and view rate limiting parameters for a queue, the [QueueRateLimit Class](api/classes/QueueRateLimit.md) provides the following methods: - -- [QueueRateLimit.set()](api/classes/QueueRateLimit.md#set) -- [QueueRateLimit.clear()](api/classes/QueueRateLimit.md#clear) -- [QueueRateLimit.get()](api/classes/QueueRateLimit.md#get) - **Example** ```javascript @@ -26,7 +20,9 @@ const queueRateLimit = new QueueRateLimit(); // Setting a rate limit of 200 msg/min for the 'notofications' queue queueRateLimit.set('notifications', { limit: 200, interval: 60000 }, (err) => { // ... -}) +}); ``` -Queue rate limiting parameters can be also configured using the [HTTP API Interface](https://github.com/weyoss/redis-smq-monitor) or from your browser with the help of the [Web UI](https://github.com/weyoss/redis-smq-monitor-client). \ No newline at end of file +To configure and view rate limiting parameters for a queue, the [QueueRateLimit Class](api/classes/QueueRateLimit.md). + +Queue rate limiting parameters can be also configured using the [HTTP API Interface](https://github.com/weyoss/redis-smq-monitor) or from your browser with the help of the [Web UI](https://github.com/weyoss/redis-smq-monitor-client). diff --git a/docs/queues.md b/docs/queues.md index d5a6aef6..6763d8bc 100644 --- a/docs/queues.md +++ b/docs/queues.md @@ -17,12 +17,17 @@ In a typical use case, both LIFO and FIFO queues use [brpoplpush](https://redis. In a LIFO queue the last published messages are always delivered first and the first published messages are delivered last. ```javascript -const { Queue } = require('redis-smq'); +const { Queue, EQueueType, EQueueDeliveryModel } = require('redis-smq'); const queue = new Queue(); - -// Creating a LIFO queue named 'my_lifo_queue' in the 'default' namespace. -queue.save('my_lifo_queue', EQueueType.LIFO_QUEUE, (err) => console.error(err)); +queue.save( + 'my_queue', + EQueueType.LIFO_QUEUE, + EQueueDeliveryModel.POINT_TO_POINT, + (err) => { + if (err) console.error(err); + }, +); ``` See [Queue.save()](api/classes/Queue.md#save) for more details. @@ -34,12 +39,17 @@ See [Queue.save()](api/classes/Queue.md#save) for more details. In a FIFO queue the first published messages are delivered first and the last published messages are delivered last. ```javascript -const { QueueManager } = require('redis-smq'); +const { Queue, EQueueType, EQueueDeliveryModel } = require('redis-smq'); const queue = new Queue(); - -// Creating a FIFO queue named 'my_fifo_queue' in the 'default' namespace. -queue.save('my_fifo_queue', EQueueType.FIFO_QUEUE, (err) => console.error(err)); +queue.save( + 'my_queue', + EQueueType.FIFO_QUEUE, + EQueueDeliveryModel.POINT_TO_POINT, + (err) => { + if (err) console.error(err); + }, +); ``` See [Queue.save()](api/classes/Queue.md#save) for more details. @@ -51,12 +61,17 @@ See [Queue.save()](api/classes/Queue.md#save) for more details. In a priority queue, messages with higher priority are always delivered first before messages with lower priority. ```javascript -const { QueueManager } = require('redis-smq'); +const { Queue, EQueueType, EQueueDeliveryModel } = require('redis-smq'); const queue = new Queue(); - -// Creating a PRIORITY queue named 'my_priority_queue' in the 'default' namespace. -queue.save('my_priority_queue', EQueueType.PRIORITY_QUEUE, (err) => console.error(err)); +queue.save( + 'my_queue', + EQueueType.PRIORITY_QUEUE, + EQueueDeliveryModel.POINT_TO_POINT, + (err) => { + if (err) console.error(err); + }, +); ``` See [Queue.save()](api/classes/Queue.md#save) for more details. @@ -65,8 +80,8 @@ See [Queue.save()](api/classes/Queue.md#save) for more details. To set up a message priority, the [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides the following methods: -* [ProducibleMessage.setPriority()](api/classes/ProducibleMessage.md#setpriority) -* [ProducibleMessage.getPriority()](api/classes/ProducibleMessage.md#getpriority) +- [ProducibleMessage.setPriority()](api/classes/ProducibleMessage.md#setpriority) +- [ProducibleMessage.getPriority()](api/classes/ProducibleMessage.md#getpriority) Valid message priority values that you can apply to a given message are: @@ -123,4 +138,4 @@ RedisSMQ provides: - [QueuePendingMessages Class](api/classes/QueuePendingMessages.md) - To browse queue pending messages - [QueueAcknowledgedMessages Class](api/classes/QueueAcknowledgedMessages.md) - To browse/requeue/delete queue acknowledged messages - [QueueDeadLetteredMessages Class](api/classes/QueueDeadLetteredMessages.md) - To browse/requeue/delete queue dead-lettered messages -- [QueueScheduledMessages Class](api/classes/QueueScheduledMessages.md) - To browse/delete queue scheduled messages \ No newline at end of file +- [QueueScheduledMessages Class](api/classes/QueueScheduledMessages.md) - To browse/delete queue scheduled messages diff --git a/docs/scheduling-messages.md b/docs/scheduling-messages.md index 2bc0d6e5..fc9ac8b0 100644 --- a/docs/scheduling-messages.md +++ b/docs/scheduling-messages.md @@ -6,12 +6,12 @@ Starting with version 1.0.19, RedisSMQ enables you to schedule a one-time or rep To set up scheduling parameters for a given message, the [ProducibleMessage Class](api/classes/ProducibleMessage.md) provides: -* [ProducibleMessage.setScheduledCRON()](api/classes/ProducibleMessage.md#setscheduledcron) -* [ProducibleMessage.setScheduledDelay()](api/classes/ProducibleMessage.md#setscheduleddelay) -* [ProducibleMessage.setScheduledRepeat()](api/classes/ProducibleMessage.md#setscheduledrepeat) -* [ProducibleMessage.setScheduledRepeatPeriod()](api/classes/ProducibleMessage.md#setscheduledrepeatperiod) +- [ProducibleMessage.setScheduledCRON()](api/classes/ProducibleMessage.md#setscheduledcron) +- [ProducibleMessage.setScheduledDelay()](api/classes/ProducibleMessage.md#setscheduleddelay) +- [ProducibleMessage.setScheduledRepeat()](api/classes/ProducibleMessage.md#setscheduledrepeat) +- [ProducibleMessage.setScheduledRepeatPeriod()](api/classes/ProducibleMessage.md#setscheduledrepeatperiod) -To schedule your message, you can publish it, as any other message, from your [Producer Class](api/classes/Producer.md) +To schedule your message, you can publish it, as any other message, from your [Producer Class](api/classes/Producer.md) using the [Producer.produce()](api/classes/Producer.md#produce) method. ```javascript @@ -27,11 +27,11 @@ msg producer.produce(msg, (err) => { if (err) console.error(err); else console.log('Message has been successfully scheduled'); -}) +}); ``` For managing scheduled messages see [QueueScheduledMessages Class](api/classes/QueueScheduledMessages.md). To delete a scheduled message see [Message.deleteMessageById()](api/classes/Message.md#deletemessagebyid). -Scheduled messages can be also managed using the [HTTP API Interface](https://github.com/weyoss/redis-smq-monitor) or from your browser with the help of the [Web UI](https://github.com/weyoss/redis-smq-monitor-client). \ No newline at end of file +Scheduled messages can be also managed using the [HTTP API Interface](https://github.com/weyoss/redis-smq-monitor) or from your browser with the help of the [Web UI](https://github.com/weyoss/redis-smq-monitor-client).