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

How to implement distributed transactions between Easy Batch and IBM MQ? #370

Closed
czhifa opened this issue Mar 31, 2020 · 2 comments
Closed
Labels

Comments

@czhifa
Copy link

czhifa commented Mar 31, 2020

Anyone has integrated IBM MQ with Easy Batch, please?

Could you share the experience on how to deal with distributed transaction scenario. For example, read message in Reader class, and deal with some persistence operations in Processor, or Writer in TRANSACTION mode. BTW, I am using Easy-Batch 4.0 version.

Thanks in advance

@czhifa czhifa changed the title How to implement distributed transaction between easy batch and MQ? How to implement distributed transactions between Easy Batch and IBM MQ? Mar 31, 2020
@fmbenhassine
Copy link
Member

@czhifa I never worked with IBM MQ, but I can give some hints.

For example, read message in Reader class, and deal with some persistence operations in Processor, or Writer in TRANSACTION mode.

I would not recommend doing persistence operations in a record processor, it is better to implement them in a writer.

There is no global transactions in Easy Batch. What you can do is read a message from a queue, and if the transaction fails in the writer, send the item back to the queue for reprocessing (you can use the record header to add some infos like the number of times the record has been retried, etc).

This is basically the compensating action pattern, which is in my experience easier to implement and reason about than distributed transactions and 2PC. You can find some references here: Compensating Transaction pattern and Sagas. Hope this helps.

@czhifa
Copy link
Author

czhifa commented Apr 6, 2020

Thank you so much for taking the time to reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants