@lucaapp/service-utils 1.14.0 → 1.14.2
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.
|
@@ -156,7 +156,7 @@ class KafkaClient {
|
|
|
156
156
|
};
|
|
157
157
|
this.consume = async (kafkaTopic, handler, fromBeginning = false) => {
|
|
158
158
|
const topic = await this.getTopic(kafkaTopic);
|
|
159
|
-
const groupId = `${this.environment.valueOf()}_${this.serviceIdentity.identityName}`;
|
|
159
|
+
const groupId = `${this.environment.valueOf()}_${kafkaTopic.valueOf()}_${this.serviceIdentity.identityName}`;
|
|
160
160
|
try {
|
|
161
161
|
const consumer = this.kafkaClient.consumer({ groupId });
|
|
162
162
|
this.consumers.push(consumer);
|
|
@@ -172,7 +172,11 @@ class KafkaClient {
|
|
|
172
172
|
const decryptedValue = await this.decryptValue(kafkaTopic, message.value);
|
|
173
173
|
await this.verifySignature(kafkaTopic, decryptedValue, message.headers);
|
|
174
174
|
const value = this.parseValue(decryptedValue);
|
|
175
|
-
this.logger.debug({
|
|
175
|
+
this.logger.debug({
|
|
176
|
+
key: message.key?.toString(),
|
|
177
|
+
value,
|
|
178
|
+
timestamp: message.timestamp,
|
|
179
|
+
}, 'Record received');
|
|
176
180
|
await handler({ ...message, value });
|
|
177
181
|
messageAcknowledgedCounter
|
|
178
182
|
.labels({ topic: kafkaTopic.valueOf(), groupId })
|
|
@@ -133,7 +133,8 @@ class ServiceIdentity {
|
|
|
133
133
|
this.axiosClient = axios_1.default.create({ proxy: false });
|
|
134
134
|
if (!debug) {
|
|
135
135
|
this.axiosClient.interceptors.response.use(response => response, error => {
|
|
136
|
-
if (error
|
|
136
|
+
if (Array.isArray(error?.config?.headers) &&
|
|
137
|
+
error.config.headers.contains(JWT_HEADER_NAME)) {
|
|
137
138
|
delete error.config.headers[JWT_HEADER_NAME];
|
|
138
139
|
}
|
|
139
140
|
return Promise.reject(error);
|