v3.4.0
Features
Add retry count to persistent subscription events
Adds retryCount
property to events from subscribeToPersistentSubscriptionToStream
and subscribeToPersistentSubscriptionToAll
View
const subscription = client.subscribeToPersistentSubscriptionToStream(
STREAM_NAME,
GROUP_NAME
);
for await (const event of subscription) {
try {
console.log(
`handling event ${event.event?.type} with retryCount ${event.retryCount}`
);
await handleEvent(event);
await subscription.ack(event);
} catch (error) {
await subscription.nack(PARK, error.toString(), event);
}
}