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

@PostCreate #740

Open
RichardHightower opened this issue Jun 20, 2016 · 1 comment
Open

@PostCreate #740

RichardHightower opened this issue Jun 20, 2016 · 1 comment

Comments

@RichardHightower
Copy link
Member

    @QueueCallback(QueueCallbackType.INIT)
    fun connectionInit() {
        checkConnectionBreaker()
    }


    @QueueCallback(QueueCallbackType.SHUTDOWN)
    fun shutdown() {
        try {
            connectionBreaker.ifOk {
                it.close()
            }.cleanup { it.close() }
        } catch (ex : Exception) {
            logger.warn("unable to close connection", ex)
        }
    }

The above should also work like this

    @PostCreate
    fun connectionInit() {
        checkConnectionBreaker()
    }


    @PreDestroy
    fun shutdown() {
        try {
            connectionBreaker.ifOk {
                it.close()
            }.cleanup { it.close() }
        } catch (ex : Exception) {
            logger.warn("unable to close connection", ex)
        }
    }
@RichardHightower
Copy link
Member Author

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

1 participant