Message acknowledgement with external subsystems #907
Replies: 2 comments 6 replies
-
They are all present on a received message, can you hold onto the message and when the subsystem responds just call msg.Ack() or msg.Nak()? |
Beta Was this translation helpful? Give feedback.
-
How do you handle retries or multiple processing of the same info. I understand that the async subsystem is a black box but I don’t understand the solution design. Keeping the msg in a blocked goroutine until processing is done would make it possible to use acks the simple way (including extending and nak). If you pick up the completion via some other means (webhook or similar), a normal nats request/reply would be a great way to “find” the right goroutine. Or if there is many many requests, get the nats msg from a map or something and then ack it. Either way, mechanisms for idempotemcy and retry/fallback actions should also be considered (and that can be very hard to do unless “someone” holds the active msg. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am looking for a robust way to acknowledge a message after being asynchronously processed by a subsystem e.g. some external library that is not under my control, thus I cannot pass the Msg and call Ack.
The current approach passes the reply string to the subsystem. When the subsystem responses I simply call Publish on the nats connection with either +ACK or -ACK. Unfortunately, ackAck and ackNak are private in the nats go client, thus it feels a bit hacky.
I am interested in your opinion about that solution and if there are plans to support such a use case in a simpler way e.g. by adding additional methods Ack, Nak, Term, etc. in the Jetstream interface.
Regards
Beta Was this translation helpful? Give feedback.
All reactions