Skip to content

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

Open

Description

@amartins27

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.

Activity

  1. cies commented on Sep 5, 2024

    @cies
    Contributor

    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.

  2. amartins27 commented on Sep 6, 2024

    @amartins27
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions