@jetit/publisher 3.2.0 → 3.2.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetit/publisher",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
6
  "@jetit/id": "0.0.11",
@@ -184,10 +184,17 @@ class Streams {
184
184
  const processMessage = async (redisClient, messageId, processPending = false) => {
185
185
  console.log(`PUBLISHER: Processing message ${messageId} for ${streamName}`);
186
186
  try {
187
- const pendingDetails = await redisClient.xpending(streamName, this.consumerGroupName, messageId, messageId, this.instanceId);
188
- if (pendingDetails[2] === 0) {
189
- console.warn(`PUBLISHER: Message ${messageId} for ${streamName} already acknowledged.`);
190
- return;
187
+ try {
188
+ const pendingDetails = await redisClient.xpending(streamName, this.consumerGroupName, messageId, messageId, 1, this.instanceId);
189
+ if (pendingDetails[2] === 0) {
190
+ console.warn(`PUBLISHER: Message ${messageId} for ${streamName} already acknowledged.`);
191
+ return;
192
+ }
193
+ }
194
+ catch (e) {
195
+ // Ignore the xpending error and continue
196
+ console.error('XPENDING ERROR: To be handled');
197
+ console.warn(JSON.stringify(e));
191
198
  }
192
199
  const messages = await redisClient.xrange(streamName, messageId, messageId);
193
200
  if (messages && messages.length) {