@onlineapps/mq-client-core 1.0.59 → 1.0.61

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/README.md CHANGED
@@ -29,6 +29,7 @@ const mqClient = new BaseClient({
29
29
 
30
30
  await mqClient.connect();
31
31
  await mqClient.publish('workflow.init', { workflowId: '123', data: '...' });
32
+ await mqClient.publish('workflow.control', { workflowId: '123', data: '...' });
32
33
  ```
33
34
 
34
35
  ### Configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/mq-client-core",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Core MQ client library for RabbitMQ - shared by infrastructure services and connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -42,6 +42,27 @@ module.exports = {
42
42
  }
43
43
  },
44
44
 
45
+ /**
46
+ * workflow.control - Shared queue for service-agnostic control-flow steps
47
+ * All business services listen as competing consumers (same pattern as workflow.init).
48
+ *
49
+ * Purpose:
50
+ * - Execute control-flow steps that are not pinned to a specific service
51
+ * - Keep workflow.init as a clear "gateway entrypoint" queue (no semantic overload)
52
+ *
53
+ * TTL: 30 seconds - if no business service processes message within 30s, it expires
54
+ * DLQ routing: Expired messages go to workflow.failed
55
+ */
56
+ control: {
57
+ durable: true,
58
+ arguments: {
59
+ 'x-message-ttl': 30000,
60
+ 'x-max-length': 10000,
61
+ 'x-dead-letter-exchange': '',
62
+ 'x-dead-letter-routing-key': 'workflow.failed'
63
+ }
64
+ },
65
+
45
66
  /**
46
67
  * workflow.completed - Completed workflows
47
68
  */
@@ -54,7 +75,8 @@ module.exports = {
54
75
  },
55
76
 
56
77
  /**
57
- * workflow.failed - Failed workflows
78
+ * workflow.failed - Failed workflows (DLQ entry point)
79
+ * Workflows land here after max retries exhausted, waiting for human decision
58
80
  */
59
81
  failed: {
60
82
  durable: true,
@@ -64,6 +86,18 @@ module.exports = {
64
86
  }
65
87
  },
66
88
 
89
+ /**
90
+ * workflow.discarded - Discarded workflows (final state)
91
+ * Workflows land here after human decision to discard from DLQ
92
+ */
93
+ discarded: {
94
+ durable: true,
95
+ arguments: {
96
+ 'x-message-ttl': 300000, // 5 minutes TTL
97
+ 'x-max-length': 10000
98
+ }
99
+ },
100
+
67
101
  /**
68
102
  * workflow.dlq - Dead letter queue for workflows
69
103
  */