@onlineapps/conn-orch-cookbook 2.0.16 → 2.0.18
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/examples/basicUsage.js +11 -6
- package/package.json +4 -4
package/examples/basicUsage.js
CHANGED
|
@@ -10,17 +10,22 @@
|
|
|
10
10
|
* 6. Graceful shutdown on process signals
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
function requireEnv(name, description) {
|
|
14
|
+
const value = process.env[name];
|
|
15
|
+
if (!value || String(value).trim() === '') {
|
|
16
|
+
throw new Error(`[conn-orch-cookbook][example] Missing environment variable - ${name} is required. ${description || ''}`);
|
|
17
|
+
}
|
|
18
|
+
return String(value).trim();
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
const { ServiceRegistryClient, EVENTS } = require('agent-registry-client');
|
|
17
22
|
|
|
18
23
|
// Step 1: Create a new ServiceRegistryClient instance
|
|
19
24
|
const registryClient = new ServiceRegistryClient({
|
|
20
|
-
amqpUrl:
|
|
21
|
-
serviceName:
|
|
22
|
-
version:
|
|
23
|
-
heartbeatInterval: parseInt(process.env.HEARTBEAT_INTERVAL, 10)
|
|
25
|
+
amqpUrl: requireEnv('AMQP_URL', 'RabbitMQ URL (IPv4-only recommended: amqp://user:pass@127.0.0.1:PORT)'),
|
|
26
|
+
serviceName: requireEnv('SERVICE_NAME', 'Service logical name'),
|
|
27
|
+
version: requireEnv('SERVICE_VERSION', 'Service version (SemVer)'),
|
|
28
|
+
heartbeatInterval: process.env.HEARTBEAT_INTERVAL ? parseInt(process.env.HEARTBEAT_INTERVAL, 10) : undefined,
|
|
24
29
|
apiQueue: process.env.API_QUEUE,
|
|
25
30
|
registryQueue: process.env.REGISTRY_QUEUE
|
|
26
31
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-cookbook",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"description": "Complete cookbook toolkit for all services - unified wrapper including core, executor, transformer, and router functionality",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"homepage": "https://github.com/onlineapps/connector-cookbook#readme",
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@onlineapps/cookbook-core": "2.1.16",
|
|
50
|
-
"@onlineapps/cookbook-executor": "1.0.
|
|
51
|
-
"@onlineapps/cookbook-router": "1.0.
|
|
52
|
-
"@onlineapps/cookbook-template-helpers": "1.0.
|
|
50
|
+
"@onlineapps/cookbook-executor": "1.0.11",
|
|
51
|
+
"@onlineapps/cookbook-router": "1.0.13",
|
|
52
|
+
"@onlineapps/cookbook-template-helpers": "1.0.10",
|
|
53
53
|
"@onlineapps/cookbook-transformer": "1.1.5",
|
|
54
54
|
"jsonpath": "1.1.1"
|
|
55
55
|
},
|