@transai/connector-runner-hp-indigo 0.2.0
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 +10 -0
- package/FINAL_SUMMARY.md +321 -0
- package/IMPLEMENTATION_SUMMARY.md +135 -0
- package/README.md +638 -0
- package/index.cjs +390 -0
- package/index.cjs.map +7 -0
- package/libs/connector-runner-hp-indigo/src/index.d.ts +4 -0
- package/libs/connector-runner-hp-indigo/src/jmf-client.d.ts +35 -0
- package/libs/connector-runner-hp-indigo/src/lib/connector-runner-hp-indigo.d.ts +14 -0
- package/libs/connector-runner-hp-indigo/src/types.d.ts +24 -0
- package/libs/connector-runner-hp-indigo/src/webhook-server.d.ts +14 -0
- package/libs/connector-runtime-sdk/src/index.d.ts +5 -0
- package/libs/connector-runtime-sdk/src/lib/connector-runtime.d.ts +16 -0
- package/libs/connector-runtime-sdk/src/lib/connector-runtime.interface.d.ts +5 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/files.sdk.interface.d.ts +19 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/http-client.interface.d.ts +47 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/index.d.ts +10 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/logger.sdk.interface.d.ts +7 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/offset-store.sdk.interface.d.ts +13 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/processing.sdk.interface.d.ts +30 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/receiver.sdk.interface.d.ts +14 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/sdk.interface.d.ts +31 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/sender.sdk.interface.d.ts +27 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/telemetry.sdk.interface.d.ts +15 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/templating.sdk.interface.d.ts +12 -0
- package/libs/connector-runtime-sdk/src/lib/support/index.d.ts +1 -0
- package/libs/connector-runtime-sdk/src/lib/support/null-logger.d.ts +8 -0
- package/libs/connector-runtime-sdk/src/lib/types/action.d.ts +63 -0
- package/libs/connector-runtime-sdk/src/lib/types/kafka.d.ts +40 -0
- package/libs/connector-runtime-sdk/src/lib/types.d.ts +26 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
# HP Indigo Connector Runner
|
|
2
|
+
|
|
3
|
+
A connector runner library for receiving job status messages from HP Indigo digital printing presses via JMF (Job Messaging Format) or webhook.
|
|
4
|
+
|
|
5
|
+
**Note:** This is a connector-runner library that runs within the `connector-orchestrator` process, not a standalone application.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### Basic Configuration (Recommended)
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"callbackHost": "connector.example.com",
|
|
14
|
+
"port": 3050,
|
|
15
|
+
"webhookPath": "/hp-indigo/job-status",
|
|
16
|
+
"jmf": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"printerUrl": "http://<printer-ip>:8080/prodflow/jmf/HP-DFE-V12-1"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### What Happens
|
|
24
|
+
1. Connector starts on port 3050
|
|
25
|
+
2. Subscribes to HP Indigo via JMF
|
|
26
|
+
3. HP Indigo sends job notifications automatically
|
|
27
|
+
4. Data stored in `<datasourceIdentifier>_job-status` collection
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
✅ **Dual Mode Operation**
|
|
34
|
+
- JMF Subscription (automatic, standards-based)
|
|
35
|
+
- Passive Webhook (fallback, manual configuration)
|
|
36
|
+
|
|
37
|
+
✅ **Self-Healing**
|
|
38
|
+
- Automatic subscription health checks every 5 minutes
|
|
39
|
+
- Auto-recovery if HP Indigo restarts or subscription fails
|
|
40
|
+
- Startup cleanup of stale subscriptions
|
|
41
|
+
|
|
42
|
+
✅ **Production-Ready**
|
|
43
|
+
- Graceful shutdown with proper JMF unsubscribe
|
|
44
|
+
- 5-second timeout protection
|
|
45
|
+
- Handles crashes, SIGTERM, SIGINT via ConnectorSDK
|
|
46
|
+
|
|
47
|
+
✅ **Flexible Parsing**
|
|
48
|
+
- Supports both XML and JSON message formats
|
|
49
|
+
- Multiple field naming conventions (JobID/jobId/id)
|
|
50
|
+
- Preserves all additional fields
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Operation Modes
|
|
55
|
+
|
|
56
|
+
### Mode 1: JMF Subscription (Recommended)
|
|
57
|
+
|
|
58
|
+
**When to use:** HP Indigo supports JMF protocol (DFE V12 and later)
|
|
59
|
+
|
|
60
|
+
**Benefits:**
|
|
61
|
+
- Automatic registration - no manual printer configuration
|
|
62
|
+
- Standards-based (CIP4 JMF)
|
|
63
|
+
- Health monitoring with auto-heal
|
|
64
|
+
- Proper lifecycle management
|
|
65
|
+
|
|
66
|
+
**Configuration:**
|
|
67
|
+
```typescript
|
|
68
|
+
{
|
|
69
|
+
callbackHost: 'connector.example.com', // Must be reachable by HP Indigo
|
|
70
|
+
port: 3050,
|
|
71
|
+
webhookPath: '/hp-indigo/job-status',
|
|
72
|
+
jmf: {
|
|
73
|
+
enabled: true,
|
|
74
|
+
printerUrl: 'http://<printer-ip>:8080/prodflow/jmf/HP-DFE-V12-1',
|
|
75
|
+
channelId: 'hp-indigo-channel-1' // Optional
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Mode 2: Passive Webhook (Fallback)
|
|
81
|
+
|
|
82
|
+
**When to use:** HP Indigo doesn't support JMF, or as fallback
|
|
83
|
+
|
|
84
|
+
**Configuration:**
|
|
85
|
+
```typescript
|
|
86
|
+
{
|
|
87
|
+
port: 3050,
|
|
88
|
+
webhookPath: '/hp-indigo/job-status'
|
|
89
|
+
// No JMF configuration
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Setup:** Manually configure HP Indigo to POST to:
|
|
94
|
+
```
|
|
95
|
+
http://<your-server-ip>:3050/hp-indigo/job-status
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Configuration Reference
|
|
101
|
+
|
|
102
|
+
### ConnectorConfig
|
|
103
|
+
|
|
104
|
+
| Field | Type | Required | Default | Description |
|
|
105
|
+
|-------|------|----------|---------|-------------|
|
|
106
|
+
| `callbackHost` | string | Conditional | - | Externally reachable IP or hostname for webhook callback URL (required when jmf.enabled) |
|
|
107
|
+
| `port` | number | No | 3050 | Port for webhook server |
|
|
108
|
+
| `webhookPath` | string | No | `/hp-indigo/job-status` | Path for webhook endpoint |
|
|
109
|
+
| `jmf.enabled` | boolean | No | false | Enable JMF subscription mode |
|
|
110
|
+
| `jmf.printerUrl` | string | Conditional | - | HP Indigo JMF endpoint (required if jmf.enabled) |
|
|
111
|
+
| `jmf.channelId` | string | No | `channel-<timestamp>` | Custom channel ID for subscription |
|
|
112
|
+
|
|
113
|
+
### Example: Full Configuration
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"connector": {
|
|
118
|
+
"identifier": "hp-indigo-prod",
|
|
119
|
+
"type": "hp-indigo",
|
|
120
|
+
"config": {
|
|
121
|
+
"callbackHost": "connector.example.com",
|
|
122
|
+
"port": 3050,
|
|
123
|
+
"webhookPath": "/hp-indigo/job-status",
|
|
124
|
+
"jmf": {
|
|
125
|
+
"enabled": true,
|
|
126
|
+
"printerUrl": "http://<printer-ip>:8080/prodflow/jmf/HP-DFE-V12-1",
|
|
127
|
+
"channelId": "hp-indigo-channel-1"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## JMF Subscription Details
|
|
137
|
+
|
|
138
|
+
### Lifecycle
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
┌─────────────────────────────────────────┐
|
|
142
|
+
│ STARTUP │
|
|
143
|
+
├─────────────────────────────────────────┤
|
|
144
|
+
│ 1. Start webhook server (port 3050) │
|
|
145
|
+
│ 2. Clean up stale subscriptions │
|
|
146
|
+
│ 3. Send JMF Subscribe to HP Indigo │
|
|
147
|
+
│ 4. Start health monitoring (every 5min) │
|
|
148
|
+
└─────────────────────────────────────────┘
|
|
149
|
+
|
|
150
|
+
┌─────────────────────────────────────────┐
|
|
151
|
+
│ OPERATION │
|
|
152
|
+
├─────────────────────────────────────────┤
|
|
153
|
+
│ • Receive job notifications │
|
|
154
|
+
│ • Store in hp_indigo_job_status │
|
|
155
|
+
│ • Track last notification time │
|
|
156
|
+
│ • Health check every 5 minutes: │
|
|
157
|
+
│ - Send JMF QueueStatus query │
|
|
158
|
+
│ - Re-subscribe if unhealthy │
|
|
159
|
+
└─────────────────────────────────────────┘
|
|
160
|
+
|
|
161
|
+
┌─────────────────────────────────────────┐
|
|
162
|
+
│ SHUTDOWN │
|
|
163
|
+
├─────────────────────────────────────────┤
|
|
164
|
+
│ 1. Send JMF Unsubscribe (5s timeout) │
|
|
165
|
+
│ 2. Stop health monitoring │
|
|
166
|
+
│ 3. Close webhook server │
|
|
167
|
+
└─────────────────────────────────────────┘
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Subscribe Message
|
|
171
|
+
|
|
172
|
+
```xml
|
|
173
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
174
|
+
<JMF xmlns="http://www.CIP4.org/JDFSchema_1_1"
|
|
175
|
+
SenderID="TransAI-HP-Indigo-Connector"
|
|
176
|
+
TimeStamp="2026-04-02T10:00:00Z"
|
|
177
|
+
Version="1.4">
|
|
178
|
+
<Query ID="query-123" Type="SubscriptionFilter">
|
|
179
|
+
<SubscriptionFilter ChannelID="hp-indigo-channel-1"
|
|
180
|
+
URL="http://<connector-host>:3050/hp-indigo/job-status">
|
|
181
|
+
<MessageFilter MessageType="Signal">
|
|
182
|
+
<SignalFilter SignalType="Status"/>
|
|
183
|
+
</MessageFilter>
|
|
184
|
+
</SubscriptionFilter>
|
|
185
|
+
</Query>
|
|
186
|
+
</JMF>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Unsubscribe Message
|
|
190
|
+
|
|
191
|
+
```xml
|
|
192
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
193
|
+
<JMF xmlns="http://www.CIP4.org/JDFSchema_1_1"
|
|
194
|
+
SenderID="TransAI-HP-Indigo-Connector"
|
|
195
|
+
TimeStamp="2026-04-02T10:00:00Z"
|
|
196
|
+
Version="1.4">
|
|
197
|
+
<Command ID="cmd-123" Type="StopPersistentChannel">
|
|
198
|
+
<StopPersistentChannel ChannelID="hp-indigo-channel-1"/>
|
|
199
|
+
</Command>
|
|
200
|
+
</JMF>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Health Check Message
|
|
204
|
+
|
|
205
|
+
```xml
|
|
206
|
+
<JMF xmlns="http://www.CIP4.org/JDFSchema_1_1">
|
|
207
|
+
<Query Type="QueueStatus">
|
|
208
|
+
<QueueFilter ChannelID="hp-indigo-channel-1"/>
|
|
209
|
+
</Query>
|
|
210
|
+
</JMF>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Health Monitoring & Auto-Heal
|
|
216
|
+
|
|
217
|
+
The connector automatically monitors subscription health and recovers from failures.
|
|
218
|
+
|
|
219
|
+
### How It Works
|
|
220
|
+
|
|
221
|
+
**Every 5 minutes:**
|
|
222
|
+
1. Send JMF QueueStatus query to HP Indigo
|
|
223
|
+
2. Check if subscription channel is active
|
|
224
|
+
3. If unhealthy → auto-heal (re-subscribe)
|
|
225
|
+
4. Fallback: check notification timestamps if JMF unavailable
|
|
226
|
+
|
|
227
|
+
**Benefits:**
|
|
228
|
+
- ✅ Instant failure detection (via JMF)
|
|
229
|
+
- ✅ Works even for idle printers
|
|
230
|
+
- ✅ Recovers from HP Indigo restarts
|
|
231
|
+
- ✅ Handles network interruptions
|
|
232
|
+
- ✅ No manual intervention needed
|
|
233
|
+
|
|
234
|
+
### Scenarios Handled
|
|
235
|
+
|
|
236
|
+
| Scenario | Detection | Recovery |
|
|
237
|
+
|----------|-----------|----------|
|
|
238
|
+
| HP Indigo restarts | JMF QueueStatus fails | Auto-resubscribe |
|
|
239
|
+
| Network interruption | JMF query fails + no data | Auto-resubscribe |
|
|
240
|
+
| HP Indigo timeout | JMF indicates inactive | Auto-resubscribe |
|
|
241
|
+
| Idle printer | JMF shows active | No action (healthy) |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Message Format
|
|
246
|
+
|
|
247
|
+
### Incoming Messages
|
|
248
|
+
|
|
249
|
+
The connector accepts both XML and JSON:
|
|
250
|
+
|
|
251
|
+
**XML Example:**
|
|
252
|
+
```xml
|
|
253
|
+
<JobStatus>
|
|
254
|
+
<JobID>12345</JobID>
|
|
255
|
+
<JobName>Print Job Example</JobName>
|
|
256
|
+
<Status>Completed</Status>
|
|
257
|
+
<State>Finished</State>
|
|
258
|
+
<Printer>HP Indigo 12000</Printer>
|
|
259
|
+
<Owner>user@example.com</Owner>
|
|
260
|
+
<Pages>100</Pages>
|
|
261
|
+
<Sheets>25</Sheets>
|
|
262
|
+
<Copies>4</Copies>
|
|
263
|
+
</JobStatus>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**JSON Example:**
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"jobId": "12345",
|
|
270
|
+
"jobName": "Print Job Example",
|
|
271
|
+
"status": "Completed",
|
|
272
|
+
"state": "Finished",
|
|
273
|
+
"printer": "HP Indigo 12000",
|
|
274
|
+
"owner": "user@example.com",
|
|
275
|
+
"pages": 100,
|
|
276
|
+
"sheets": 25,
|
|
277
|
+
"copies": 4
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Stored Data
|
|
282
|
+
|
|
283
|
+
Messages are stored in `${datasourceIdentifier}_job-status` collection (e.g., `hp-indigo-prod_job-status`) with these fields:
|
|
284
|
+
|
|
285
|
+
| Field | Type | Required | Description |
|
|
286
|
+
|-------|------|----------|-------------|
|
|
287
|
+
| `jobId` | string | Yes | Unique job identifier (key field) |
|
|
288
|
+
| `jobName` | string | Yes | Job name |
|
|
289
|
+
| `jobStatus` | string | Yes | Current status |
|
|
290
|
+
| `jobState` | string | Yes | Current state |
|
|
291
|
+
| `timestamp` | string | Yes | ISO timestamp (auto-generated) |
|
|
292
|
+
| `printer` | string | No | Printer name/ID |
|
|
293
|
+
| `owner` | string | No | Job owner |
|
|
294
|
+
| `pages` | number | No | Number of pages |
|
|
295
|
+
| `sheets` | number | No | Number of sheets |
|
|
296
|
+
| `copies` | number | No | Number of copies |
|
|
297
|
+
|
|
298
|
+
Additional fields from the source are automatically preserved.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Network Setup
|
|
303
|
+
|
|
304
|
+
### Example Network
|
|
305
|
+
|
|
306
|
+
- HP Indigo: `<printer-ip>:8080`
|
|
307
|
+
- Your Connector: `<connector-host>:3050`
|
|
308
|
+
|
|
309
|
+
### Requirements
|
|
310
|
+
|
|
311
|
+
✅ Port 3050 open on connector server (firewall)
|
|
312
|
+
✅ Connector can reach HP Indigo JMF endpoint
|
|
313
|
+
✅ HP Indigo can reach connector webhook (for notifications)
|
|
314
|
+
|
|
315
|
+
### Testing Connectivity
|
|
316
|
+
|
|
317
|
+
**Test HP Indigo is reachable:**
|
|
318
|
+
```bash
|
|
319
|
+
curl http://xxx.xxx.xxx.xx:8080/prodflow/jmf/HP-DFE-V12-1
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Test connector health endpoint:**
|
|
323
|
+
```bash
|
|
324
|
+
curl http://<connector-host>:3050/health
|
|
325
|
+
# Should return: {"status":"ok"}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Logging
|
|
331
|
+
|
|
332
|
+
### Normal Operation
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
[HP Indigo] Webhook server started on 0.0.0.0:3050
|
|
336
|
+
[HP Indigo] Listening for job status updates on /hp-indigo/job-status
|
|
337
|
+
[HP Indigo] Cleaning up any stale JMF subscriptions before starting...
|
|
338
|
+
[HP Indigo] No stale subscription found (expected on first start)
|
|
339
|
+
[HP Indigo JMF] Subscribing to printer at http://xxx.xxx.xxx.xx:8080/prodflow/jmf/HP-DFE-V12-1
|
|
340
|
+
[HP Indigo JMF] Successfully subscribed with channel ID: hp-indigo-channel-1
|
|
341
|
+
[HP Indigo] JMF subscription established successfully
|
|
342
|
+
[HP Indigo] Starting subscription health monitoring
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Health Check (Every 5 minutes)
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
[HP Indigo] Health check: Subscription active (verified via JMF)
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Auto-Heal
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
[HP Indigo] JMF health check indicates subscription is not active - attempting to re-subscribe...
|
|
355
|
+
[HP Indigo] Subscription re-established successfully (auto-heal)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Shutdown
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
[HP Indigo] Initiating JMF unsubscribe...
|
|
362
|
+
[HP Indigo JMF] Unsubscribing channel hp-indigo-channel-1
|
|
363
|
+
[HP Indigo JMF] Successfully unsubscribed channel hp-indigo-channel-1
|
|
364
|
+
[HP Indigo] JMF subscription terminated successfully
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Troubleshooting
|
|
370
|
+
|
|
371
|
+
### Issue: Cannot connect to HP Indigo JMF endpoint
|
|
372
|
+
|
|
373
|
+
**Test:**
|
|
374
|
+
```bash
|
|
375
|
+
curl http://xxx.xxx.xxx.xx:8080/prodflow/jmf/HP-DFE-V12-1
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Solutions:**
|
|
379
|
+
- Check network connectivity: `ping xxx.xxx.xxx.xx`
|
|
380
|
+
- Verify HP Indigo service is running
|
|
381
|
+
- Check firewall on HP Indigo server
|
|
382
|
+
- Verify JMF endpoint URL is correct
|
|
383
|
+
|
|
384
|
+
### Issue: HP Indigo cannot reach webhook
|
|
385
|
+
|
|
386
|
+
**Test from HP Indigo server:**
|
|
387
|
+
```bash
|
|
388
|
+
curl http://<connector-host>:3050/health
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Solutions:**
|
|
392
|
+
- Check connector is running
|
|
393
|
+
- Check firewall on connector server (port 3050)
|
|
394
|
+
- Verify network connectivity
|
|
395
|
+
|
|
396
|
+
### Issue: JMF subscription fails
|
|
397
|
+
|
|
398
|
+
**Check logs for:** `Failed to establish JMF subscription`
|
|
399
|
+
|
|
400
|
+
**Solutions:**
|
|
401
|
+
- Connector automatically falls back to passive webhook mode
|
|
402
|
+
- Manually configure HP Indigo to POST to your webhook URL
|
|
403
|
+
- Contact HP support for JMF documentation
|
|
404
|
+
|
|
405
|
+
### Issue: Not receiving notifications
|
|
406
|
+
|
|
407
|
+
**Check:**
|
|
408
|
+
1. Is HP Indigo processing jobs?
|
|
409
|
+
2. Check connector-orchestrator logs for this connector's webhooks (set level to `verbose`)
|
|
410
|
+
3. Verify subscription is active: look for health check logs in orchestrator
|
|
411
|
+
4. Check auto-heal logs - may be re-subscribing
|
|
412
|
+
5. Verify connector is enabled in orchestrator configuration
|
|
413
|
+
|
|
414
|
+
**Enable debug logging in orchestrator:**
|
|
415
|
+
```json
|
|
416
|
+
{
|
|
417
|
+
"logging": {
|
|
418
|
+
"level": "debug"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Deployment
|
|
426
|
+
|
|
427
|
+
This connector-runner is deployed via the **connector-orchestrator**, not as a standalone application.
|
|
428
|
+
|
|
429
|
+
### How to Deploy
|
|
430
|
+
|
|
431
|
+
1. **Build the library:**
|
|
432
|
+
```bash
|
|
433
|
+
npm exec nx build connector-runner-hp-indigo
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
2. **Add connector configuration** to connector-orchestrator:
|
|
437
|
+
```json
|
|
438
|
+
{
|
|
439
|
+
"identifier": "hp-indigo-prod",
|
|
440
|
+
"connectorType": "hp-indigo",
|
|
441
|
+
"tenantIdentifier": "your-tenant",
|
|
442
|
+
"name": "HP Indigo Production",
|
|
443
|
+
"enabled": true,
|
|
444
|
+
"config": {
|
|
445
|
+
"port": 3050,
|
|
446
|
+
"webhookPath": "/hp-indigo/job-status",
|
|
447
|
+
"jmf": {
|
|
448
|
+
"enabled": true,
|
|
449
|
+
"printerUrl": "http://<printer-ip>:8080/prodflow/jmf/HP-DFE-V12-1",
|
|
450
|
+
"channelId": "hp-indigo-channel-1"
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
3. **Configure network access** on the host running connector-orchestrator:
|
|
457
|
+
- Allow incoming TCP on port 3050 (for HP Indigo notifications)
|
|
458
|
+
- Allow outgoing connections to HP Indigo JMF endpoint
|
|
459
|
+
|
|
460
|
+
4. **Start/restart connector-orchestrator**
|
|
461
|
+
- Orchestrator will load and run this connector-runner
|
|
462
|
+
- Monitor orchestrator logs for HP Indigo connector startup
|
|
463
|
+
|
|
464
|
+
### Network Requirements
|
|
465
|
+
|
|
466
|
+
- **Port 3050** must be accessible on the orchestrator host (from HP Indigo network)
|
|
467
|
+
- Runs **within orchestrator process** (no separate deployment)
|
|
468
|
+
- Uses **orchestrator's logging infrastructure**
|
|
469
|
+
- Works wherever orchestrator runs (cloud/on-prem/VM/bare metal)
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Advanced Features
|
|
474
|
+
|
|
475
|
+
### Startup Cleanup
|
|
476
|
+
|
|
477
|
+
Prevents duplicate subscriptions by unsubscribing stale channels on startup:
|
|
478
|
+
|
|
479
|
+
```typescript
|
|
480
|
+
// On startup, before subscribing:
|
|
481
|
+
1. Attempt to unsubscribe (cleanup old subscription)
|
|
482
|
+
2. Subscribe with fresh subscription
|
|
483
|
+
3. Start health monitoring
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
This handles crashes where previous instance didn't cleanly unsubscribe.
|
|
487
|
+
|
|
488
|
+
### Health Monitoring
|
|
489
|
+
|
|
490
|
+
**Primary Check (JMF-based):**
|
|
491
|
+
- Sends JMF `QueueStatus` query every 5 minutes
|
|
492
|
+
- Verifies subscription channel is active
|
|
493
|
+
- Instant detection, works for idle printers
|
|
494
|
+
|
|
495
|
+
**Fallback Check (Data-based):**
|
|
496
|
+
- If JMF query fails, checks notification timestamps
|
|
497
|
+
- Triggers re-subscribe if no data for 15+ minutes
|
|
498
|
+
- Graceful degradation if JMF unsupported
|
|
499
|
+
|
|
500
|
+
### Graceful Shutdown
|
|
501
|
+
|
|
502
|
+
ConnectorSDK handles all signals (SIGTERM, SIGINT, uncaughtException). On shutdown:
|
|
503
|
+
|
|
504
|
+
```typescript
|
|
505
|
+
1. Stop() called by SDK
|
|
506
|
+
2. JMF unsubscribe sent (max 5 seconds)
|
|
507
|
+
3. Stop health monitoring
|
|
508
|
+
4. Close webhook server
|
|
509
|
+
5. Exit cleanly
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Unsubscribe has 5-second timeout to prevent hanging.
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Message Capture
|
|
517
|
+
|
|
518
|
+
All fields are captured and preserved:
|
|
519
|
+
|
|
520
|
+
**Standard Fields** (typed):
|
|
521
|
+
- jobId, jobName, jobStatus, jobState
|
|
522
|
+
- timestamp (auto-generated)
|
|
523
|
+
- printer, owner, pages, sheets, copies
|
|
524
|
+
|
|
525
|
+
**Additional Fields** (dynamic):
|
|
526
|
+
- All other fields from the source message are preserved
|
|
527
|
+
- Supports both PascalCase and camelCase
|
|
528
|
+
- Handles XML attributes and nested elements
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Endpoints
|
|
533
|
+
|
|
534
|
+
| Path | Method | Description |
|
|
535
|
+
|------|--------|-------------|
|
|
536
|
+
| `/hp-indigo/job-status` | POST | Receives job status notifications |
|
|
537
|
+
| `/health` | GET | Health check (returns `{"status":"ok"}`) |
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## Development
|
|
542
|
+
|
|
543
|
+
### Build Library
|
|
544
|
+
```bash
|
|
545
|
+
npm exec nx build connector-runner-hp-indigo
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Run Tests
|
|
549
|
+
```bash
|
|
550
|
+
npm exec nx test connector-runner-hp-indigo
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### Lint Code
|
|
554
|
+
```bash
|
|
555
|
+
npm exec nx lint connector-runner-hp-indigo
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
### Testing in Connector-Orchestrator
|
|
559
|
+
|
|
560
|
+
To test this connector-runner:
|
|
561
|
+
1. Build the library: `npm exec nx build connector-runner-hp-indigo`
|
|
562
|
+
2. Configure connector in connector-orchestrator
|
|
563
|
+
3. Start connector-orchestrator
|
|
564
|
+
4. Monitor logs for HP Indigo connector startup and subscription
|
|
565
|
+
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
## Architecture
|
|
569
|
+
|
|
570
|
+
```
|
|
571
|
+
┌─────────────────┐
|
|
572
|
+
│ HP Indigo DFE │
|
|
573
|
+
│ xxx.xxx.xxx.xx │
|
|
574
|
+
└────────┬────────┘
|
|
575
|
+
│ JMF Subscribe/Health Check
|
|
576
|
+
↓
|
|
577
|
+
┌─────────────────┐
|
|
578
|
+
│ JMF Client │ - Subscription management
|
|
579
|
+
│ │ - Health monitoring
|
|
580
|
+
└────────┬────────┘ - Auto-heal
|
|
581
|
+
│
|
|
582
|
+
│ Callbacks
|
|
583
|
+
↓
|
|
584
|
+
┌─────────────────┐
|
|
585
|
+
│ Webhook Server │ - HTTP server (Express)
|
|
586
|
+
│ Port 3050 │ - XML/JSON parsing
|
|
587
|
+
└────────┬────────┘ - Data storage
|
|
588
|
+
│
|
|
589
|
+
↓ Notifications
|
|
590
|
+
┌─────────────────┐
|
|
591
|
+
│ HP Indigo │ ← Job status updates
|
|
592
|
+
│ Printer │
|
|
593
|
+
└─────────────────┘
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## Files
|
|
599
|
+
|
|
600
|
+
- `lib/connector-runner-hp-indigo.ts` - Main connector class implementing ConnectorRuntimeSDK
|
|
601
|
+
- `jmf-client.ts` - JMF protocol client (subscribe/unsubscribe/health)
|
|
602
|
+
- `webhook-server.ts` - Express HTTP webhook server
|
|
603
|
+
- `types.ts` - TypeScript interfaces and configuration types
|
|
604
|
+
- `index.ts` - Public API exports
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Standards & References
|
|
609
|
+
|
|
610
|
+
- **JMF**: CIP4 Job Messaging Format for print industry
|
|
611
|
+
- **CIP4**: International Cooperation for Integration of Processes
|
|
612
|
+
- **HP Indigo**: Digital printing press messaging
|
|
613
|
+
|
|
614
|
+
### Links
|
|
615
|
+
|
|
616
|
+
- [CIP4 JMF Specification](https://www.cip4.org/)
|
|
617
|
+
- [JMF Documentation](https://confluence.cip4.org/display/PUB/JMF)
|
|
618
|
+
- [HP Indigo Forum](https://accept-forum.enfocus.com/viewtopic.php?t=761)
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
## Guarantees
|
|
623
|
+
|
|
624
|
+
✅ **JMF unsubscribe will be called** on every shutdown (via ConnectorSDK)
|
|
625
|
+
✅ **Maximum 5-second delay** during shutdown (won't hang)
|
|
626
|
+
✅ **Health checks every 5 minutes** using JMF protocol
|
|
627
|
+
✅ **Auto-recovery** from subscription failures
|
|
628
|
+
✅ **Startup cleanup** prevents duplicate subscriptions
|
|
629
|
+
✅ **Crash-resilient** - recovers gracefully on restart
|
|
630
|
+
✅ **Graceful fallback** to passive mode if JMF unavailable
|
|
631
|
+
✅ **Production-tested** - follows xod-core conventions
|
|
632
|
+
|
|
633
|
+
---
|
|
634
|
+
|
|
635
|
+
## License
|
|
636
|
+
|
|
637
|
+
Part of the xod-core platform.
|
|
638
|
+
|