-
Notifications
You must be signed in to change notification settings - Fork 137
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
Simplify and split HonoClient for applications versus protocol adapters #780
Comments
I think that current approach is not consistent - e.g; having telemetry & event senders but not command consumers and command response senders.
|
Hi @avgustinmm : as I wrote we have the However, we agree on that the hono client needs to be more clearly separated for the needs of
Now it is separated by the features which undoubtedly is not good. I propose to have an interface hierarchy for this purpose:
IMHO this would lead to three maven modules (instead of one that we have now):
This would need some code to be moved to the client module for the adapter specific part, which currently is only available in the adapter module hierarchy. By this way the implementation of Command and Control for new adapters should be eased (and OSGi should be supported as well, if I see things correctly). This should address your current concerns - do you agree? If yes, I would rewrite the issue description to be more concise. |
I like the idea of splitting into This means that we are talking about quite an API break in |
@sophokles73 first quick comment regarding postponing it to 0.9: I already wanted to propose the same, so 👍 from me for removing it from 0.8. |
Right, this is exactly the idea.
Absolutely - this is why I completely agree to not force it into 0.8 (and do the mentioned thorough testing while doing it for 0.9). |
So I would move this to 0.9 if no one objects today? |
The Hono auth component also uses the credentialsService and tenantService clients of HonoClient.
Instead of using Therefore I would suggest:
Concerning the
Instead of parameterizing HonoClient via generics here (so that
This also prevents possible confusion about whether the HonoClient instance on which |
…licationClient. Signed-off-by: Carsten Lohmann <[email protected]>
I agree, we will need to have a more fine grained way of getting clients for the arbitrary (south bound) services instead of just having a single factory which is shaped according to the needs of protocol adapters only. I would also like to separate the client factories from the connection management so that we do not need to change the connection management class(es) with each change we make to the services. |
The factory methods for creating the arbitrary service clients have been refactored into dedicated interfaces. Signed-off-by: Kai Hudalla <[email protected]>
The factory methods for creating the arbitrary service clients have been refactored into dedicated interfaces. Signed-off-by: Kai Hudalla <[email protected]>
The factory methods for creating CommandConsumers have been refactored into a dedicated interface. Signed-off-by: Kai Hudalla <[email protected]>
…ory. The protocol adapters have been changed to use the CommandConsumerFactory instead of the CommandConnection. Signed-off-by: Kai Hudalla <[email protected]>
The factory methods for creating CommandConsumers have been refactored into a dedicated interface. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the CommandConsumerFactory instead of the CommandConnection. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the TenantClientFactory instead of the HonoClient. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the TenantClientFactory instead of the HonoClient. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the RegistrationClientFactory instead of the HonoClient for creating RegistrationClient instances. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the RegistrationClientFactory instead of the HonoClient for creating RegistrationClient instances. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the CredentialsClientFactory instead of the HonoClient for creating CredentialsClient instances. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the CredentialsClientFactory instead of the HonoClient for creating CredentialsClient instances. Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the DownstreamSenderFactory instead of the HonoClient for creating MessageSender instances. Signed-off-by: Kai Hudalla <[email protected]>
The protocol adapters have been changed to use the DownstreamSenderFactory instead of the HonoClient for creating MessageSender instances. Signed-off-by: Kai Hudalla <[email protected]>
Connections are now established and shut down via ConnectionLifecycle. Thus, the existing methods accepting HonoClient as a parameter are now obsolete. Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
Signed-off-by: Kai Hudalla <[email protected]>
HonoConnection will only be responsible for managing the underlying AMQP connection and will no longer serve as a factory for service clients anymore. The changed class name better reflects this fact. Signed-off-by: Kai Hudalla <[email protected]>
The DownstreamSenderFactory methods have been moved from HonoConnectionImpl to DownstreamSenderFactoryImpl. As part of this, the org.eclipse.hono.client.impl.*ClientImpl hierarchy has been refactored to use a HonoConnection instance instead of passing around multiple properties of the connection explicitly. This serves as the groundwork for implementing the other client factories analogously to the DownstreamSenderFactory. Signed-off-by: Kai Hudalla <[email protected]>
The methods for creating TenantClient instances have been moved from HonoConnectionImpl to TenantClientFactoryImpl. Signed-off-by: Kai Hudalla <[email protected]>
The methods for creating RegistrationClient instances have been moved from HonoConnectionImpl to RegistrationClientFactoryImpl. Signed-off-by: Kai Hudalla <[email protected]>
The methods for creating CredentialsClient instances have been moved from HonoConnectionImpl to CredentialsClientFactoryImpl. Signed-off-by: Kai Hudalla <[email protected]>
The methods for creating MessageConsumer, CommandClient and AsyncCommandClient instances have been moved from HonoConnectionImpl to ApplicationClientFactoryImpl. Signed-off-by: Kai Hudalla <[email protected]>
The methods for creating command consumer links and CommandResponseSender instances no longer depend on HonoConnectionImpl. Signed-off-by: Kai Hudalla <[email protected]>
fixed in da36835 |
Originating from a discussion on the dev mailing list, I think we should split the HonoClient to at least two different use cases:
what typical applications need
what (custom) protocol adapters need
I am sure this needs some discussion - I can imagine that the tenant, credentials and registration clients might be desirable to have available outside a protocol adapter as well, so that we would have three different clients.
A use case for that could be a device registry client application IMHO.
The point of this issue is to come to a more focussed HonoClient, so that an application developer should not have to ask a question like "why do I have a telemetry sender available, but I cannot use it since I can only consume telemetry messages?". The same question could be asked for the tenant, credentials and registration clients, for which the remote APIs are usually not accessible for applications.
After having discussed this issue, we can rewrite it to describe what we want to achieve in the future with HonoClient (and possibly split it up).
Remark: for Command and Control we already made a small step into this direction : the
CommandConnection
is an extension ofHonoClient
and thus does not provide it's methods to applications.The text was updated successfully, but these errors were encountered: