Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Support for Multiple MqttDataTransport per gateway(how to publish to multiple brokers from a single app)
Support for Multiple MqttDataTransport per gateway [message #1562111] Tue, 13 January 2015 13:59 Go to next message
regis piccand is currently offline regis piccandFriend
Messages: 4
Registered: January 2015
Junior Member
Hey guys,

New to Kura, I'm trying to workout how to have multiple brokers available to the same app for publishing mqtt messages.

I guess the problem is that I don't understand how the CloudService gets bound to the DataService, which then gets bound to the MqttDataTransport (which has a configuration for broker-url).

Can the CloudService support multiple broker url ? could an app support multiple cloudServices ? where is the binding between those service instances specified?

Thanks for your support!
-Regis
Re: Support for Multiple MqttDataTransport per gateway [message #1562769 is a reply to message #1562111] Tue, 13 January 2015 22:32 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello Regis,

There is no mechanism in Kura to handle multiple broker connections. Kura can manage a single broker connection across different applications, but the assumption is always a single broker.

The key interfaces to focus on are:

DataTransportService - This provides the low level MQTT communications. This is where the broker URL is defined. The MqttDataTransport you mention is the implementation of the DataTransportService.

DataService - This provides addition features on top of the DataTransportService. These features include: managing connection, buffering messages, setting message priority etc.

CloudService - This further extends the DataService. The CloudService offers several features, but in particular this is what manages multiple applications on a single broker connection.

Let me know if you need more information. I would also encourage you to read through the APIs for these interfaces.

Thanks,
--Dave
Re: Support for Multiple MqttDataTransport per gateway [message #1564467 is a reply to message #1562769] Wed, 14 January 2015 20:27 Go to previous messageGo to next message
regis piccand is currently offline regis piccandFriend
Messages: 4
Registered: January 2015
Junior Member
Hello David,

Thanks for this reply. I now understand that there can be only a single CloudService instance running per gateway instance.

If I was to develop an AMQP DataTransportService implementation, what would I have to do to have this implementation injected into the DataServiceImpl instead of the MQTTDataTransport ?

Thanks
Regis
Re: Support for Multiple MqttDataTransport per gateway [message #1575606 is a reply to message #1564467] Tue, 20 January 2015 22:53 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Regis,

Sorry for the slow reply. Once you have a DataTransportService implementation using AMQP, you will need to register the service with your new implementation. You can use the existing MQTT data transport component definition for reference [1]. Since you will now have two target services named DataTransportService, you will also need to set the service.ranking property in your component. Please reference the OSGi specification for details on this, but you should add a property similar to:

<property name="service.ranking" type="Integer" value="10"/>

This should bind the DataService to your new AMQP DataTransportService. Let me know if you need further clarification on anything.

[1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core/OSGI-INF/mqttDataTransport.xml

Thanks,
--Dave
Previous Topic:How to Manage Multiple devices in KURA
Next Topic:MQTT error on Beaglebone with debian
Goto Forum:
  


Current Time: Thu Apr 18 11:57:09 GMT 2024

Powered by FUDForum. Page generated in 0.01412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top