Skip to content

Improve documentation for exit code generation #5038

Closed
@prasenjit-net

Description

@prasenjit-net

I was using the exit code generator feature and as per the document

In addition, beans may implement the org.springframework.boot.ExitCodeGenerator interface if they wish to return a specific exit code when the application ends.

Does this bean gets called whenever a proper shut down happen, or it require a call to SpringApplication.exit static method?

For me first option is not happening on a spring boot console application i.e. no web dependency. But when I call the SpringApplication.exit static method ExitCodeGenerator.getExitCode is called but still returns exit code 0 and also it forces the tests to fail with a message that

Ensure that the context has not been closed programmatically.

example can be found here boot-exitcode

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions