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

[#3214] Decouple readiness checks from verticle deployment #3223

Conversation

sophokles73
Copy link
Contributor

The Kafka based clients have been adapted to provide a readiness check
that is independent from the clients' startup. This is to better
resemble the behavior of Hono's other components and also to not block
the deployment of verticles during startup of Hono services and
adapters.

Fixes #3214

*
* @return A succeeded future. Note that the successful completion of the returned future does not
* mean that the consumer will be ready to receive messages from the broker.
*/
@Override
public Future<Void> start() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is currently

        if (kafkaConsumer == null) {
            return Future.failedFuture("not started");

in the stop() method. The failed future there marked a programming error - calling stop() before start().
Since kafkaConsumer is now null for some time after start() is completed, the stop() method should be adapted.
In case of kafkaConsumer == null it would also be best to make the KafkaClientFactory instance stop any further client creation attempts.

The Kafka based clients have been adapted to provide a readiness check
that is independent from the clients' startup. This is to better
resemble the behavior of Hono's other components and also to not block
the deployment of verticles during startup of Hono services and
adapters.

Fixes eclipse-hono#3214

Signed-off-by: Kai Hudalla <[email protected]>
@sophokles73 sophokles73 force-pushed the decouple_readiness_check_from_startup branch from 05fc24f to df18da4 Compare May 4, 2022 09:41
@sophokles73
Copy link
Contributor Author

@calohmn would you mind taking another look?

Signed-off-by: Kai Hudalla <[email protected]>
@sophokles73
Copy link
Contributor Author

@calohmn I have pushed changes

@calohmn calohmn mentioned this pull request May 4, 2022
Signed-off-by: Kai Hudalla <[email protected]>
@sophokles73
Copy link
Contributor Author

@calohmn I have pushed changes

Signed-off-by: Kai Hudalla <[email protected]>
@sophokles73
Copy link
Contributor Author

@calohmn I have pushed a change

Copy link
Contributor

@calohmn calohmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sophokles73 sophokles73 merged commit 02b0a91 into eclipse-hono:master May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use consistent approach for readiness checks involving Kafka connections
2 participants