-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should return published message's sequence number when in confirm mode #63
Comments
I have changed publishMsg to return the sequence number: 333e8d4 I'm not a big fan of breaking changes, but in this case it seems unlikely to break a lot of code and should be easy to fix. Let me know if it works for you. |
That's working well for me, thanks! It might also be worth a mention in the docs that channels in confirm mode aren't thread safe. |
Do you mean that the publishMsg method isn't thread-safe or is there something else? |
I don't think publishMsg can be used in a thread safe manner in confirm mode. I think this is possible:
It's not a problem if you're not tracking which messages have been confirmed, but then I don't know why you'd be in confirm mode. |
I think it could be made thread-safe if there was a lock around |
I'm only using one thread - just thought I'd bring it to your attention - but an An alternative might be to have
Not expecting to see this implemented here - although I might have a play around with this myself and report back. |
I updated the implementation to be thread-safe. Regarding your suggestion, I'm not sure it would be worth the risk of breaking backwards-compatibility. The biggest benefit would be slightly improved performance. But there are other ways we could improve the performance of |
I totally agree about backwards compatibility - was just thinking out loud. I'll have a play with the new threadsafe fix over the weekend and let you know how it goes. |
Either getting
publishMsg
to return it or via a new wrapping method as it would be a breaking change to the API.Not being able to match the outgoing message with the
delivery-tag
in theaddConfirmationListener
method prevents additional, message specific logic from being performed. e.g. to mark messages as having been published in an external system.The text was updated successfully, but these errors were encountered: