The io.transport.mqtt implementation is too restrictive [message #1766231] |
Mon, 19 June 2017 03:42 |
David Graeff Messages: 17 Registered: April 2016 |
Junior Member |
|
|
The io.transport.mqtt bundle is very restrictive in what functionality it exports. At the moment it allows:
- (un)registerConnectionObserver: Notification about dis/connection to a known broker.
- (un)registerMessageConsumer: Subscribe to a topic on a known broker.
- (un)registerMessageProducer: Send data to a known broker.
It does not allow to alter or enumerate the brokers, only known ones can be accessed. It does not allow to access the underlying MqttBrokerConnection. But access would be necessary for the following exemplaric reasons:
I'd like to make the following changes to the bundle and would like to collect some feedback first:
- Make the getConnection method of MqttService public. Export the MqttBrokerConnection class.
- Allow to replace the X509TrustManager in a MqttBrokerConnection.
- Add means, to add/remove a MqttBrokerConnection to MqttService. This way a broker discovery binding could be written, which adds/removes brokers to the MqttService.
- Add a way to enumerate the brokers in MqttService and get notified of added/removed ones. This way binding writers can write discovery services for ESH things, that represent a specific topic on a matching broker.
- Remove MqttBrokerConnection::setAsync. Use IMqttActionListener to be asynchronously notified of success/fail of a MqttDeliveryToken and notify the producer asynchronously in return, instead of block / waiting for a response (https://github.com/eclipse/smarthome/blob/master/bundles/io/org.eclipse.smarthome.io.transport.mqtt/src/main/java/org/eclipse/smarthome/io/transport/mqtt/internal/MqttBrokerConnection.java#L467)
Issue on github: https://github.com/eclipse/smarthome/issues/3695
Cheers, David
[Updated on: Mon, 19 June 2017 03:46] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03273 seconds