enioka-Haute-Couture / jqm

An asynchronous job manager
Apache License 2.0
96 stars 25 forks source link

Support for 2PC/XA for job API #279

Open fabiogermann opened 7 years ago

fabiogermann commented 7 years ago

It would be advantageous to be able to enqueue jobs (using the client library) in the context of a transaction.

Is there something similar on the road map?

marcanpilami commented 7 years ago

Hello,

this is not currently on the roadmap, as it would introduce a difference between the client implementation using web services (which cannot reliably propagate a transaction) and the one using raw JDBC (which could), and we like our APIs to be consistent. Also, because no customer expressed this need before ;-)

That said, this is actually doable. We could detect if a transaction manager is present and if the datasource is an XA DS, and not commit explicitly in that case. (obviously the DS retrieval would have to change depending on the container too). All the client API verbs which actually modify data (enqueue, change queue, cancel, kill...) would have to be changed in the same way to preserve consistency.

So it's quite a bit of work (not even talking about tests in different containers), not the kind which can be done without a motivated contributor or a paying customer. I'll therefore put this in the backlog and up for grabs, but not in the roadmap. I realize this is not the answer you expected, sorry about that, but still thanks for contributing your requirements!