Skip to content
Discussion options

You must be logged in to vote

I'm not a JTA expert but I think that you could actually delay the actual shutdown with quarkus.shutdown.delay-enabled=true and @ShutdownDelayInitiated logic. For example something like:

@ApplicationScoped
public class MyBean {

    @Inject
    OutboxService os;

    @Inject
    EntityManager em;

    private final AtomicBoolean shutdownInitiated = new AtomicBoolean(false);
    private final AtomicBoolean checkInProgress = new AtomicBoolean(false);

    @Scheduled(
            every = "10s",
            concurrentExecution = Scheduled.ConcurrentExecution.SKIP
    )
    @Transactional
    public void check() {
        if (shutdownInitiated.get()) {
           // Shutdown initiated - skip e…

Replies: 2 comments 16 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
16 replies
@bttger
Comment options

@mkouba
Comment options

mkouba Oct 29, 2025
Collaborator

@bttger
Comment options

@mkouba
Comment options

mkouba Oct 30, 2025
Collaborator

Answer selected by bttger
@manovotn
Comment options

@mkouba
Comment options

mkouba Oct 30, 2025
Collaborator

@gsmet
Comment options

@mkouba
Comment options

mkouba Oct 30, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
4 participants