Skip to content
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

JMS: txSource should report rollbacks #1855

Closed
ennru opened this issue Aug 5, 2019 · 5 comments
Closed

JMS: txSource should report rollbacks #1855

ennru opened this issue Aug 5, 2019 · 5 comments
Labels
Milestone

Comments

@ennru
Copy link
Member

ennru commented Aug 5, 2019

Short description

When a JMS transactional message is rolled back, this should be inspectable by the user at least via log messages with a hint to the ack-timeout setting.

Possibly, the users should be able to let the stream fail if the ACK timeout is hit and a message is rolled back.

Details

The current JMS.txSource automatically calls rollback when the ack-timeout (default 1 s) is hit, but this can't be noticed by the consumer.

val action = Await.result(envelope.commitFuture, settings.ackTimeout)
action()
} catch {
case _: TimeoutException => session.session.rollback()
case e: IllegalArgumentException => handleError.invoke(e) // Invalid envelope. Fail the stage.
case e: jms.JMSException => handleError.invoke(e)

See #1831

@ennru ennru added the p:jms label Aug 5, 2019
@ennru ennru added this to the 1.1.1 milestone Aug 5, 2019
@WellingR
Copy link
Member

WellingR commented Aug 5, 2019

Actually, just a log message may not be enough. I would rather see that the commit (and maybe also rollback) methods on the TxEvenlope would throw an exception to make it clear that the message was already rolled back.

@ennru
Copy link
Member Author

ennru commented Aug 6, 2019

Yes, that makes sense and would be expected. Changing it would break backwards compatibility for code that handles duplicated messages correctly today, though.

@WellingR
Copy link
Member

WellingR commented Aug 6, 2019

Perhaps an alternative could be for the commit/rollback method to return a future which completes when the commit/rollback has actually been handled

@ennru
Copy link
Member Author

ennru commented Aug 6, 2019

In #1857 I suggest a backwards-compatible way to improve this.
For Alpakka 2.0 we could look into further improvements.

@ennru
Copy link
Member Author

ennru commented Aug 7, 2019

Improved with #1857.

@ennru ennru closed this as completed Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants