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

New method "afterInvocation" similar to "afterRequest" but also works on jobs #1495

Open
amartins27 opened this issue Aug 26, 2024 · 2 comments

Comments

@amartins27
Copy link

Is your feature request related to a problem? Please describe.
Is there any reason why the afterRequest method was implemented just for requests and not for jobs?

Describe the solution you'd like
I would like to launch jobs once the current jobs is finished, to make sure the transaction is commited before the next jobs start.

@cies
Copy link
Contributor

cies commented Sep 5, 2024

We stopped using Play1's job runner as it did not have a proper queue'ing system. Now we use a self-rolled jobs system that is AWS/SQS backed. Simple, persisted, scalable. Our crons are in AWS/CloudWatch (crons are infra for us).

We use RePlay now by the way, but we already started using this new system when we were still on Play1.

@amartins27
Copy link
Author

I see a lot of things that are great about RePlay, will definitly have that in mind. Instead of jobs you are using SQS messages and then several consumers? How do you handle order in that case?

The issue I'm having is that I'm creating entities in JobA, that entity triggers JobB on @PostPersist. Then on JobB I'm getting session errors because the transaction on JobA is still not commited...
This does not happen in a request context because of afterRequest. Changing that method to also consider job context does works, but I'm not sure if changing this has other implications.

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

No branches or pull requests

2 participants