Skip to content

Graceful Shutdown #14024

Answered by geekerzhou
geekerzhou asked this question in Question
Apr 2, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

my solution here:

@Log
public class ImmediateDownClosedEventListener implements ApplicationListener<ContextClosedEvent> {

    @Resource
    private DubboHealthIndicator indicator;

    public ImmediateDownClosedEventListener(DubboHealthIndicator indicator) {
        this.indicator = indicator;
    }

    @Override
    public void onApplicationEvent(ContextClosedEvent event) {
        log.info("Context is closing, setting health status to DOWN...");
        indicator.shutdownSignalReceived();
    }
}

public class DubboHealthIndicator extends AbstractHealthIndicator {

    private volatile boolean isShutdownSignalReceived = false;

    private volatile boolean dubboStarted = false;

    @…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@geekerzhou
Comment options

@AlbumenJ
Comment options

AlbumenJ Apr 7, 2024
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by geekerzhou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/need-triage Need maintainers to triage component/need-triage Need maintainers to triage
2 participants
Converted from issue

This discussion was converted from issue #14022 on April 02, 2024 06:44.