You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current design requires you to create a MQTT client implementation specific object outside of the factory and then inject it into the factory for a specific type which makes the factory methods specific and requires the clients to work with and depend on the specific MQTT5 client implementation, see example code below:
Mqtt5Client mockedClient = mock(Mqtt5Client.class);
var result = TransportFactory.createInstance(mock(UUri.class), mockedClient);
It is Ok that up-transport-mqtt5-java could support multiple client implementations other than HiveMQ (ex. paho) however the factory method should be generic such that we simply state what type we want to createInstance() of and/or also provide a default that returns a default instance of a client. In order to do this, we need to generalize the configuration options passed to MQTT5 clients in a configuration file starting with username + password but then eventually support passing certificates once we test the client for a given broker like Azure.
The current design requires you to create a MQTT client implementation specific object outside of the factory and then inject it into the factory for a specific type which makes the factory methods specific and requires the clients to work with and depend on the specific MQTT5 client implementation, see example code below:
It is Ok that up-transport-mqtt5-java could support multiple client implementations other than HiveMQ (ex. paho) however the factory method should be generic such that we simply state what type we want to createInstance() of and/or also provide a default that returns a default instance of a client. In order to do this, we need to generalize the configuration options passed to MQTT5 clients in a configuration file starting with username + password but then eventually support passing certificates once we test the client for a given broker like Azure.
then the API would be something like:
The text was updated successfully, but these errors were encountered: