@jetit/publisher 5.4.0 → 5.4.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 +1 -1
- package/src/lib/redis/streams.js +8 -4
package/package.json
CHANGED
package/src/lib/redis/streams.js
CHANGED
|
@@ -301,12 +301,12 @@ class Streams {
|
|
|
301
301
|
}
|
|
302
302
|
const bs = new rxjs_1.BehaviorSubject(null);
|
|
303
303
|
// Making the subscription Immutable
|
|
304
|
-
const subscription =
|
|
304
|
+
const subscription = {
|
|
305
305
|
subject: bs,
|
|
306
306
|
filter: eventFilter,
|
|
307
307
|
lastMatchTime: Date.now(),
|
|
308
308
|
keepAlive: filterKeepAlive,
|
|
309
|
-
}
|
|
309
|
+
};
|
|
310
310
|
eventSubscriptions.set(subscriptionId, subscription);
|
|
311
311
|
// Return early if not first subscription
|
|
312
312
|
if (!isNewSubscription) {
|
|
@@ -718,11 +718,15 @@ class Streams {
|
|
|
718
718
|
* This is used to track cleanup progress and ensure we don't delete unprocessed messages.
|
|
719
719
|
*/
|
|
720
720
|
async acknowledgeMessage(ackKey) {
|
|
721
|
-
|
|
721
|
+
let { streamName, messageId } = this.demergeMessageKey(ackKey);
|
|
722
722
|
const lastAckKey = `last_ack:${streamName}`;
|
|
723
|
+
messageId == '0' ? '0-0' : messageId;
|
|
723
724
|
try {
|
|
724
725
|
// Update last acknowledged ID and acknowledge message atomically
|
|
725
|
-
await Promise.all([
|
|
726
|
+
await Promise.all([
|
|
727
|
+
this.redisGroups.xack(streamName, this.consumerGroupName, messageId),
|
|
728
|
+
this.redisGroups.set(lastAckKey, messageId.toString()),
|
|
729
|
+
]);
|
|
726
730
|
}
|
|
727
731
|
catch (error) {
|
|
728
732
|
logger_1.PUBLISHER_LOGGER.error(`Error acknowledging message ${messageId} for ${streamName}:`, error);
|