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
[#1761] Add AMQP adapter client. #1765
[#1761] Add AMQP adapter client. #1765
Conversation
e6d1c0c
to
4de17bb
Compare
Added tracing and inherit from classes used inside the protocol adapters. |
client/src/main/java/org/eclipse/hono/client/device/amqp/AmqpAdapterClientFactory.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/hono/client/device/amqp/internal/AmqpAdapterClientCommandConsumer.java
Show resolved
Hide resolved
...main/java/org/eclipse/hono/client/device/amqp/internal/AmqpAdapterClientCommandConsumer.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/hono/client/device/amqp/internal/AmqpAdapterClientCommandConsumer.java
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/device/amqp/internal/AmqpSenderLink.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/device/amqp/TraceableCommandResponder.java
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientCommandResponseSender.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientCommandResponseSender.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientEventSenderImpl.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientTelemetrySenderImpl.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientCommandResponseSender.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientEventSenderImpl.java
Outdated
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/impl/AmqpAdapterClientTelemetrySenderImpl.java
Outdated
Show resolved
Hide resolved
@calohmn What is the status of this issue? |
@b-abel Can you squash and rebase (also to check with the new checkstyle rules introduced since) ? |
f23135b
to
62d06b1
Compare
Done. |
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
client/src/main/java/org/eclipse/hono/client/device/amqp/TraceableCommandResponder.java
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/device/amqp/AmqpAdapterClientFactory.java
Show resolved
Hide resolved
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
client/src/main/java/org/eclipse/hono/client/device/amqp/AmqpAdapterClientFactory.java
Show resolved
Hide resolved
client/src/main/java/org/eclipse/hono/client/device/amqp/TraceableCommandResponder.java
Show resolved
Hide resolved
@b-abel are you going to integrate this new client into the protocol gateway example code? |
Yes. |
I would add tests and documentation to this PR. Or do you prefer to open a new one for that? |
@b-abel any way you want it ... as long as you do create docs and tests ;-) |
@b-abel so, what's it gonna be? This PR or a separate one? |
I will add them in this PR. |
@b-abel what is the status of this PR? Are you still working on docs and tests? |
Yes. |
c57a1be
to
7ae1740
Compare
Done. |
client/src/test/java/org/eclipse/hono/client/device/amqp/TelemetrySenderTest.java
Outdated
Show resolved
Hide resolved
client/src/test/java/org/eclipse/hono/client/device/amqp/EventSenderTest.java
Outdated
Show resolved
Hide resolved
client/src/test/java/org/eclipse/hono/client/device/amqp/TraceableCommandResponderTest.java
Outdated
Show resolved
Hide resolved
client/src/test/java/org/eclipse/hono/client/device/amqp/TraceableCommandResponderTest.java
Outdated
Show resolved
Hide resolved
I added the requested changes. |
...src/test/java/org/eclipse/hono/client/AbstractAmqpAdapterClientDownstreamSenderTestBase.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/eclipse/hono/client/AbstractAmqpAdapterClientDownstreamSenderTestBase.java
Outdated
Show resolved
Hide resolved
client/src/test/java/org/eclipse/hono/client/device/amqp/CommandResponderTest.java
Outdated
Show resolved
Hide resolved
client/src/test/java/org/eclipse/hono/client/device/amqp/CommandResponderTest.java
Outdated
Show resolved
Hide resolved
Device (or gateway) clients that connect to the AMQP adapter can be created using AmqpAdapterClientFactory. The implementation reopens closed connections and restores the receiver link for consuming commands afterward. Sender links are cached and removed from the cache when closed so that they are recreated the next time they are retrieved from the factory. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
…ownstream messages. Having the content type required to send telemetry, event or command responses was a copy&paste error. The content type might not always be available. + Fix Javadoc around that. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
…write required ones. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
…Client. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
… Adapter Client. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
636840e
to
a89fe00
Compare
I just pushed an update. |
deliveryFuture.setHandler(ctx.completing()); | ||
|
||
// THEN the future waits for the disposition to be updated by the peer | ||
Thread.sleep(100L); |
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.
can you please make sure to remove all occurrences of this?
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.
Sorry, I missed them.
…p() from tests. Signed-off-by: Abel Buechner-Mihaljevic <abel.buechner-mihaljevic@bosch.io>
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 the first solution for #1761, which on the one hand uses existing code from the client module and on the other hand aims to expose as few classes as possible to the outside world that are designed for internal use in the protocol adapters.
The entry point is the factory interface
AmqpAdapterClientFactory
, which can be used to create clients.I had to put some classes into the existing
client.impl
package because of the visibility of the code used, the rest I tried to separate a little bit.Tests (and documentation) will be added once we have agreed on the overall direction.
It is a quick and easy solution, in a next step it would be good to have a simpler client interface that does not expose the link handling and scopes the connection to the tenant, but provides simple send methods. I hope to do another PR on this soon. For that, I would make a separate Maven module with minimal dependencies.