-
Notifications
You must be signed in to change notification settings - Fork 12
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
[#19] Support REST Api for sending configs and commands to devices (Device Communication API) #20
[#19] Support REST Api for sending configs and commands to devices (Device Communication API) #20
Conversation
Signed-off-by: g.dimitropoulos <[email protected]>
Thanks for the PR. hono-extras/protocol-gateway/azure-mqtt-protocol-gateway/pom.xml Lines 212 to 242 in 2be112b
to the pom of the module. To do the corresponding local IDE setup, there is a chapter in the Hono documentation. |
pool.getConnection(connection -> { | ||
if (connection.failed()) { | ||
log.error(String.format(connectionFailedMsg, connection.cause().getMessage())); | ||
System.exit(-1); |
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.
When first testing the application and starting up without a corresponding database, this System.exit
caused a deadlock ('Quarkus#blockingExit' was called on the main thread. This will result in deadlocking the application! [Error Occurred After Shutdown]
). Using Quarkus.asyncExit(-1)
instead would prevent that.
As a general note:
In the Hono components, the connection establishment to DB / messaging network components is decoupled from the (Quarkus) application startup. There are also retries being done. When a connection hasn't been established yet, the corresponding readiness check fails, in the Kubernetes context meaning the component isn't considered for incoming requests yet and is eventually getting killed if it keeps being not ready.
For the createDbClient
method here, this would mean returning a Future<PyPool>
instead. I'm still having a look at the overall structure here to get an idea of what else would need to be changed.
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.
I have replaced the system.exit with Quarkus.asyncExit.
...nication/src/main/java/org/eclipse/hono/communication/api/DeviceCommunicationHttpServer.java
Outdated
Show resolved
Hide resolved
...ce-communication/src/main/java/org/eclipse/hono/communication/core/http/HttpServiceBase.java
Outdated
Show resolved
Hide resolved
@gdimitropoulos-sotec Is #21 meant to replace this PR here? |
Hi @calohmn PR 21 adds the pub-sub functionality and is based on this PR here. |
@calohmn do you prefer to review this PR and after the 21 or should I create one PR for both? |
...nication/src/main/java/org/eclipse/hono/communication/api/DeviceCommunicationHttpServer.java
Outdated
Show resolved
Hide resolved
...nication/src/main/java/org/eclipse/hono/communication/api/DeviceCommunicationHttpServer.java
Outdated
Show resolved
Hide resolved
Sorry for the delay. I've added a last set of comments. Then we can merge this. |
Thank you for your time. I have fixed all the issues from your comments and also update the other PR with these changes. |
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, thanks for contributing.
@gdimitropoulos-sotec As a follow-up, I've adapted the GitHub Actions workflow to also build the device communication API. I've also made some small adaptations/corrections - see c01bccb. This also includes choosing a generic application docker image name and setting the |
Issue #19 is part of qualifying hono as a replacement for Google IoT Core customers (IoT Core is being retired in August 2023).
See also: eclipse-hono/hono#3441 & eclipse-hono/hono#3442
At this PR we have created the Device Communication API and the needed database table. At the moment the API is not able to communicate with the Hono command router and that will be achieved when the pub-sub communication is implemented in future PR.
Signed-off-by: g.dimitropoulos[email protected]