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
Add ApplicationClient addOnClientReadyHandler(), fix example application startup #3278
Add ApplicationClient addOnClientReadyHandler(), fix example application startup #3278
Conversation
clients/amqp-common/src/main/java/org/eclipse/hono/client/amqp/AbstractServiceClient.java
Outdated
Show resolved
Hide resolved
@@ -102,6 +103,11 @@ public KafkaApplicationClientImpl( | |||
this.consumerConfig = consumerConfig; | |||
} | |||
|
|||
@Override | |||
public void addOnClientReadyHandler(final Handler<AsyncResult<Void>> handler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this method being used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in Hono itself. But it is useful for applications using the Hono (Kafka)ApplicationClient.
@calohmn Are you still working on this? Do you want/need this in 2.0.0? |
@sophokles73 I'm still on it, yes. But I think this should be merged after the 2.0.0 release. |
@calohmn is this ready to be merged? |
@sophokles73 Not yet. |
f9ba003
to
fecf257
Compare
I've added the |
...mqp/src/main/java/org/eclipse/hono/application/client/amqp/ProtonBasedApplicationClient.java
Show resolved
Hide resolved
...mqp/src/main/java/org/eclipse/hono/application/client/amqp/ProtonBasedApplicationClient.java
Show resolved
Hide resolved
Also improve AbstractServiceClient start/stop extensibility. Signed-off-by: Carsten Lohmann <carsten.lohmann@bosch.io>
Signed-off-by: Carsten Lohmann <carsten.lohmann@bosch.io>
fecf257
to
aa10a03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is especially needed for theKafkaApplicationClient
, letting a given handler be invoked when the Kafka produceris ready.
Also introduce a lifecycleStatus in
AbstractServiceClient
, preventing successive start() invocations.Adding
addOnClientReadyHandler()
inApplicationClient
andProtonBasedApplicationClient
.(
KafkaApplicationClient
change already done in #3282.)Also fixing application client startup in Hono example application.