@palmetto/pubsub 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rabbitmq/config.d.ts +18 -3
- package/package.json +3 -3
|
@@ -27,7 +27,14 @@ export interface RabbitQueueExchangeConfigurationBase extends PubSubConfiguratio
|
|
|
27
27
|
*/
|
|
28
28
|
transport: typeof RABBITMQ_TRANSPORT;
|
|
29
29
|
/**
|
|
30
|
-
* The queue name prefix
|
|
30
|
+
* The queue name prefix. This name is used to genrate the actual exchange and queu names based on the exchange type and queue type.
|
|
31
|
+
* For topic exchanges, the topicSubscriberName is also used to generate the exchange and queue names.
|
|
32
|
+
* The final exchange and queue names will be in the format of `${name}.${topicSubscriberName}.${extension}` for topic exchanges and `${name}.${extension}` for direct exchanges, where the extension is determined by the queue type (e.g. .dlx/.dlq for dead-letter queues, .rtx/.rtq for retry queues, and no extension for default queues).
|
|
33
|
+
* The name must be unique across your publishers and subscribers to avoid naming collisions.
|
|
34
|
+
*
|
|
35
|
+
* Names should be in the format of `<service>.<model pluralized>`, for example `dispatch.suppliers` or `solarflare.events`. This helps to ensure uniqueness and also provides clarity on the source and content of the queue and exchange.
|
|
36
|
+
*
|
|
37
|
+
* Overrides can be made using {@link overrides} to specify exact exchange and queue names if the generated names do not fit your needs, or you are using legacy exchanges or queues.
|
|
31
38
|
*/
|
|
32
39
|
name: string;
|
|
33
40
|
/**
|
|
@@ -35,7 +42,7 @@ export interface RabbitQueueExchangeConfigurationBase extends PubSubConfiguratio
|
|
|
35
42
|
*/
|
|
36
43
|
temporary?: boolean;
|
|
37
44
|
/**
|
|
38
|
-
* The queue prefetch amount for subscribers. Defaults to 5 if not set.
|
|
45
|
+
* The queue prefetch amount for subscribers. This limits concurrency when processing messages. Defaults to 5 if not set.
|
|
39
46
|
*/
|
|
40
47
|
prefetch?: number;
|
|
41
48
|
/**
|
|
@@ -59,7 +66,7 @@ export interface RabbitQueueExchangeConfigurationBase extends PubSubConfiguratio
|
|
|
59
66
|
}
|
|
60
67
|
export interface RabbitQueueExchangeConfigurationTopicExchange extends RabbitQueueExchangeConfigurationBase {
|
|
61
68
|
/**
|
|
62
|
-
* For topic exchanges, the name of the subscriber is used here
|
|
69
|
+
* For topic exchanges, the name of the subscriber is used here.
|
|
63
70
|
*/
|
|
64
71
|
topicSubscriberName: string;
|
|
65
72
|
/**
|
|
@@ -73,6 +80,14 @@ export interface RabbitQueueExchangeConfigurationDirectExchange extends RabbitQu
|
|
|
73
80
|
*/
|
|
74
81
|
exchangeType: "direct";
|
|
75
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* The configuration for a RabbitMQ queue and exchange.
|
|
85
|
+
* This is used to configure the publisher and subscriber providers for RabbitMQ.
|
|
86
|
+
* Depending on the exchangeType, different properties are required.
|
|
87
|
+
* For topic exchanges, a topicSubscriberName is required to differentiate the queues for different subscribers.
|
|
88
|
+
*
|
|
89
|
+
* For full details see {@link https://github.com/palmetto/galaxy/blob/main/packages/pubsub/src/rabbitmq/README.md#queue-and-exchange-configuration}
|
|
90
|
+
*/
|
|
76
91
|
export type RabbitQueueExchangeConfiguration = RabbitQueueExchangeConfigurationDirectExchange | RabbitQueueExchangeConfigurationTopicExchange;
|
|
77
92
|
export declare function isRabbitQueueExchangeConfiguration(config: PubSubConfiguration): config is RabbitQueueExchangeConfiguration;
|
|
78
93
|
export interface RabbitQueueExchangeNames {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@palmetto/pubsub",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/palmetto/galaxy"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"lint": "yarn run -T eslint --fix ./src",
|
|
11
11
|
"format": "yarn run -T prettier --write --loglevel warn .",
|
|
12
12
|
"tc": "tsc --noEmit",
|
|
13
|
-
"test": "yarn test-runner
|
|
14
|
-
"test:watch": "yarn test-runner
|
|
13
|
+
"test": "yarn test-runner \"vitest run $@\"",
|
|
14
|
+
"test:watch": "yarn test-runner \"vitest watch $@\"",
|
|
15
15
|
"build": "yarn clean && yarn ci:build",
|
|
16
16
|
"clean": "rm -rf ./dist/",
|
|
17
17
|
"ci:build": "tsc -p tsconfig.build.json",
|