rascal 14.4.0 → 14.4.3
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/CHANGELOG.md +23 -0
- package/README.md +3 -3
- package/examples/busy-publisher/config.json +1 -1
- package/lib/amqp/Vhost.js +3 -5
- package/lib/counters/inMemoryCluster.js +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 14.4.3
|
|
4
|
+
|
|
5
|
+
- Bump dependencies
|
|
6
|
+
- superagent
|
|
7
|
+
- chance
|
|
8
|
+
- zUnit
|
|
9
|
+
- debug
|
|
10
|
+
- generic-pool
|
|
11
|
+
- lru-cache
|
|
12
|
+
- xregexp
|
|
13
|
+
- stashback
|
|
14
|
+
- chalk
|
|
15
|
+
- amqplib
|
|
16
|
+
|
|
17
|
+
## 14.4.2
|
|
18
|
+
|
|
19
|
+
- Remove timeout for filling the channel pool since generic-pool already has this option.
|
|
20
|
+
|
|
21
|
+
## 14.4.1
|
|
22
|
+
|
|
23
|
+
- Bump dependencies / fix audit warnings
|
|
24
|
+
- Fix busy publisher example to consistenly use regular channels - See https://github.com/guidesmiths/rascal/issues/194
|
|
25
|
+
|
|
3
26
|
## 14.4.0
|
|
4
27
|
|
|
5
28
|
- Report validation error when no vhosts are specified - See https://github.com/guidesmiths/rascal/issues/181
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ A **publication** is a named configuration for publishing a message, including t
|
|
|
49
49
|
|
|
50
50
|
### Breaking Changes in Rascal@14
|
|
51
51
|
|
|
52
|
-
Rascal@
|
|
52
|
+
Rascal@14 waits for inflight messages to be acknowledged before closing subscriber channels. Prior to this version Rascal just waited an arbitary amount of time. If your application does not acknowledge a message for some reason (quite likely in tests) calling `subscription.cancel`, `broker.unsubscribeAll`, `broker.bounce`, `broker.shutdown` or `broker.nuke` will wait indefinitely. You can specify a `closeTimeout` in your subscription config, however if this is exceeded the `subscription.cancel` and `broker.unsubscribeAll` methods will yield an error via callback or rejection, while the `broker.bounce`, `broker.shutdown` and `broker.nuke` methods will emit an error event, but attempt to continue. In both cases the error will have a code of `ETIMEDOUT`.
|
|
53
53
|
|
|
54
54
|
### Special Note
|
|
55
55
|
|
|
@@ -696,7 +696,7 @@ Define any further configuration in an options block
|
|
|
696
696
|
}
|
|
697
697
|
```
|
|
698
698
|
|
|
699
|
-
To define a queue with
|
|
699
|
+
To define a queue with extensions such as `x-queue-type` add arguments to the options block, e.g.
|
|
700
700
|
|
|
701
701
|
```json
|
|
702
702
|
{
|
|
@@ -875,7 +875,7 @@ await broker.publish('p1', 'some message', {
|
|
|
875
875
|
|
|
876
876
|
The callback parameters are err (indicating the publication could not be found) and publication. Listen to the publication's "success" event to obtain confirmation that the message was successfully published (when using confirm channels) and the "error" event to handle errors. The "return" event will be emitted when the message was successfully published but not routed. It is possible to access the messageId from all handlers, either via the supplied messageId or the returned message itself (see below)
|
|
877
877
|
|
|
878
|
-
If you specify the "mandatory" option (or use Rascal's defaults) you can also listen for returned messages (i.e. messages that were not delivered to any queues)
|
|
878
|
+
If you specify the "mandatory" option (or use Rascal's defaults) you can also listen for returned messages (i.e. messages that were not delivered to any queues). Before a message is returned, you will still get the "success" event, since the message was successfully published. A common mistake is to resolve a promise from the "success" event handler and reject from the "return" event handler, since the latter would have no effect.
|
|
879
879
|
|
|
880
880
|
```js
|
|
881
881
|
broker.publish('p1', 'some message', (err, publication) => {
|
package/lib/amqp/Vhost.js
CHANGED
|
@@ -357,15 +357,13 @@ function Vhost(config, components) {
|
|
|
357
357
|
function createChannelWhenInitialised(confirm, next) {
|
|
358
358
|
if (connection) return createChannel(confirm, next);
|
|
359
359
|
debug('Vhost: %s is not initialised. Deferring channel creation', self.name);
|
|
360
|
-
setTimeoutUnref(() => {
|
|
361
|
-
self.removeListener('vhost_initialised', onVhostInitialised);
|
|
362
|
-
next(new Error('Timedout acquiring channel'), 5000);
|
|
363
|
-
});
|
|
364
360
|
function onVhostInitialised() {
|
|
365
361
|
debug('Vhost: %s was initialised. Resuming channel creation', self.name);
|
|
366
362
|
createChannel(confirm, next);
|
|
367
363
|
}
|
|
368
|
-
self.once('vhost_initialised',
|
|
364
|
+
self.once('vhost_initialised', () => {
|
|
365
|
+
onVhostInitialised();
|
|
366
|
+
});
|
|
369
367
|
}
|
|
370
368
|
|
|
371
369
|
function createChannel(confirm, next) {
|
|
@@ -35,7 +35,7 @@ module.exports = {
|
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
worker: function worker(options) {
|
|
38
|
-
if (!cluster.isWorker) throw new Error("You cannot use Rascal's in
|
|
38
|
+
if (!cluster.isWorker) throw new Error("You cannot use Rascal's in memory cluster counter outside of a cluster");
|
|
39
39
|
if (!options) return worker({});
|
|
40
40
|
const timeout = options.timeout || 100;
|
|
41
41
|
const stashback = Stashback({ timeout });
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rascal",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.3",
|
|
4
4
|
"description": "A config driven wrapper for amqplib supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption, channel pooling and publication timeouts",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"async": "^3.2.
|
|
8
|
-
"debug": "^4.
|
|
7
|
+
"async": "^3.2.3",
|
|
8
|
+
"debug": "^4.3.4",
|
|
9
9
|
"forward-emitter": "^0.1.1",
|
|
10
|
-
"generic-pool": "^3.
|
|
10
|
+
"generic-pool": "^3.8.2",
|
|
11
11
|
"lodash": "^4.17.21",
|
|
12
|
-
"lru-cache": "^
|
|
12
|
+
"lru-cache": "^7.10.1",
|
|
13
13
|
"safe-json-parse": "^4.0.0",
|
|
14
|
-
"stashback": "^
|
|
15
|
-
"superagent": "^
|
|
14
|
+
"stashback": "^2.0.1",
|
|
15
|
+
"superagent": "^7.1.3",
|
|
16
16
|
"uuid": "^8.3.2",
|
|
17
|
-
"xregexp": "^5.0
|
|
17
|
+
"xregexp": "^5.1.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"amqplib": "^0.
|
|
21
|
-
"chalk": "^4.
|
|
22
|
-
"chance": "^1.1.
|
|
20
|
+
"amqplib": "^0.9.1",
|
|
21
|
+
"chalk": "^4.1.2",
|
|
22
|
+
"chance": "^1.1.8",
|
|
23
23
|
"eslint": "^7.32.0",
|
|
24
24
|
"eslint-config-prettier": "^8.3.0",
|
|
25
25
|
"eslint-plugin-prettier": "^4.0.0",
|
|
26
26
|
"husky": "^6.0.0",
|
|
27
27
|
"lint-staged": "^11.2.4",
|
|
28
28
|
"nyc": "^15.1.0",
|
|
29
|
-
"prettier": "2.4.1",
|
|
29
|
+
"prettier": "^2.4.1",
|
|
30
30
|
"random-readable": "^1.0.1",
|
|
31
31
|
"superagent-defaults": "^0.1.14",
|
|
32
|
-
"zunit": "^3.
|
|
32
|
+
"zunit": "^3.2.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"amqplib": ">=0.5.5"
|