@onlineapps/conn-orch-registry 1.1.16 → 1.1.17
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/package.json +1 -1
- package/src/registryClient.js +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Connector-registry-client provides the core communication mechanism for microservices in this environment. It enables them to interact with a services_registry to receive and fulfill tasks by submitting heartbeats or their API descriptions.",
|
|
6
6
|
"keywords": [
|
package/src/registryClient.js
CHANGED
|
@@ -123,10 +123,20 @@ class ServiceRegistryClient extends EventEmitter {
|
|
|
123
123
|
// Handle registration response from registry
|
|
124
124
|
// Registry sends 'register.confirmed' after validation
|
|
125
125
|
if ((payload.type === 'registerResponse' || payload.type === 'register.confirmed') && payload.requestId) {
|
|
126
|
+
console.log(`[RegistryClient] ${this.serviceName}: Received ${payload.type} message`, {
|
|
127
|
+
requestId: payload.requestId,
|
|
128
|
+
hasPendingRegistrations: !!(this.pendingRegistrations),
|
|
129
|
+
pendingCount: this.pendingRegistrations ? this.pendingRegistrations.size : 0,
|
|
130
|
+
hasMatchingRequest: !!(this.pendingRegistrations && this.pendingRegistrations.has(payload.requestId)),
|
|
131
|
+
pendingKeys: this.pendingRegistrations ? Array.from(this.pendingRegistrations.keys()) : []
|
|
132
|
+
});
|
|
133
|
+
|
|
126
134
|
if (this.pendingRegistrations && this.pendingRegistrations.has(payload.requestId)) {
|
|
127
135
|
const { resolve } = this.pendingRegistrations.get(payload.requestId);
|
|
128
136
|
this.pendingRegistrations.delete(payload.requestId);
|
|
129
137
|
|
|
138
|
+
console.log(`[RegistryClient] ${this.serviceName}: ✓ Resolving registration promise for requestId: ${payload.requestId}`);
|
|
139
|
+
|
|
130
140
|
// Resolve the registration promise with the response
|
|
131
141
|
resolve({
|
|
132
142
|
success: payload.success || false,
|
|
@@ -137,6 +147,8 @@ class ServiceRegistryClient extends EventEmitter {
|
|
|
137
147
|
validated: payload.validated || payload.success, // Consider successful registration as validated
|
|
138
148
|
certificate: payload.certificate || null // Include certificate from Registry
|
|
139
149
|
});
|
|
150
|
+
} else {
|
|
151
|
+
console.warn(`[RegistryClient] ${this.serviceName}: ⚠️ Received ${payload.type} with requestId ${payload.requestId}, but no matching pending registration found`);
|
|
140
152
|
}
|
|
141
153
|
}
|
|
142
154
|
|