Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [kura-dev] DataService questions

First, thanks Christiano for the speedy reply.  Some follow up questions inlined below.

<stuff deleted>

Hi Scott,

  Is there a reason for using the DataService vs the CloudClient API?

Nowadays the CloudClient should be just fine.


[Scott]  The DataService has a simpler/smaller API...and that's appealing.   We have no need for control messages at this point.


The main difference is about the topic namespace. The DataService allows you to publish an arbitrary (full) topic while with the CloudClient you can publish an "app topic" and the full topic is assembled by the CloudService layer.


[Scott] Although possibly presenting a nice set of features, our use case doesn't really need any 'app topic' distinction (at this point anyway).


The Kura default connection stack is made by three layers. In terms of Kura interfaces these are:


1. CloudService

2. DataService

3. DataTransportService


You can tap into any one of these layers.


[Scott]  Ok great.   It seemed upon initial examination that the DataService was the right entry point for us, but perhaps it's the DataTransportService.   Is there some example code (and/or internal Kura code) that shows the usage for DTS specifically?   Also:   Is the Paho Mqtt client the only implementation of DTS, or are there others?


Please note that currently you will not be able to use the DataService exclusively. The Kura CloudService implementation will publish special lifecycle messages (the birth and disconnect certificates) on connects and disconnects.


To use the DataService just add a reference to it in your component definition [1].


[Scott]  I did this and when run in the developer's workspace (on windows) I got the 'output from ls and comp commands' at the bottom...i.e. DataService was unsatisfied as were many of the Kura service components (see output below).   It's possible that all this is due to the missing mToolkit, but it's difficult for me to tell.


> How does one configure the mqtt DataService implementation?   For example, what is the default Mqtt broker URL that's used, and is it possible to configure the broker URL?


This is not configured in the DataService but in the MqttDataTransport service of the Web UI.

Just remember that using the DataService you tap into the Kura communication "layer 2".


[Scott]  Sure.  But now the question moves to the DataTransportService...i.e. how is it configured to use a specific broker.  Without the Web UI is desired right now.


> I'm using the developer workspace available here [2] on Windows (currently) and running a test bundle that references the DataService with the target platform set to /target-definition/kura-equinox_3.8.1.target.   Launching directly from Eclipse results in a number of services not being satisfied...see below for output of 'ls' and 'comp' command from OSGi console. 


The Kura developer workspace is not currently supported on Windows. Sorry.

Maybe Martin Malik who worked on the Kura port for Windows can help on this matter.

I'll ping him.


[Scott]  Ok.   FWIW there are quite a number of us that use both Linux and Windows and go between them for dev/deploy environments.


> Is there some docs on the various Kura services (e.g. DbService, DataTransferService, CloudConnectionStatusService) etc along with info about the dependencies between them?   Obviously I'm particularly interested in resolving the required dependencies for the org.eclipse.kura.core.data.DataServiceImpl  component (22 in console output below).


The Kura documentation doesn't currently shows the relationship among all these services.

Please see above for the layering of the cloud stack.

The DbService is used by the DataService to provide online buffering of messages.

The CloudConnectionStatusService is used to blink an LED showing the connection state (connected, disconnected etc).


[Scott]  FWIW it would be very helpful to have some information about the relationships between these Kura service components...i.e. which deps are required, how they are configured (programatically in our case) what their runtime guaranteed behavior is (e.g. for message delivery ordering), what are the advantages/features of using one layer or another (e.g. your DTS -> DS -> CC layers above)...e.g. control vs. app messages, msg persistence, etc.


> I haven't been able to download/install the mToolkit, and it seems that the kura-equinox_3.8.1.target platform expects to use/startup the mToolkit (in the dev workspace anyway).   Is there some way to work around this (e.g. removing bundles dependent upon the mToolkit lib)?


We are publishing alternative updates sites for mToolkit for Eclipse. We'll let know the URLs on the mailing list when these are available.

mToolkit (with a trivial code change) can run on Neon. We have imported the mToolkit SVN repo on Github and we will submit the fix there.


[Scott]  It would also be very helpful to know if there is any way to *not* use/require mToolkit in Kura?


Thanks,


Scott




Regards,

  Cristiano


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


Da: kura-dev-bounces@xxxxxxxxxxx <kura-dev-bounces@xxxxxxxxxxx> per conto di Lewis, ScottX <scottx.lewis@xxxxxxxxx>
Inviato: venerdì 9 settembre 2016 00.53.11
A: kura-dev@xxxxxxxxxxx
Oggetto: [kura-dev] DataService questions
 
Howdy,

I'm using version 2.0.1 of DataService and have a couple of questions:

1) I see that the DataService API has changed a little...e.g. deprecating org.eclipse.kura.data.DataServiceListener in favor
of org.eclipse.kura.data.listener.DataServiceListener (and the associated DataService.add/removeDataServiceListener).   I had been using the looking at the discussion/example usage here [1] .   I don't see any DataService example in the kura/examples area of source.   Are there examples from Kura or elsewhere that use the 2.0.1 approach?

2) How does one configure the mqtt DataService implementation?   For example, what is the default Mqtt broker URL that's used, and is it possible to configure the broker URL?    

3) I'm using the developer workspace available here [2] on Windows (currently) and running a test bundle that references the DataService with the target platform set to /target-definition/kura-equinox_3.8.1.target.   Launching directly from Eclipse results in a number of services not being satisfied...see below for output of 'ls' and 'comp' command from OSGi console.  

Is this (launching from Eclipse with target platform on windows) possible (e.g. for testing, etc)?   If so how is that done for use of the DataService specifically?  

4) Is there some docs on the various Kura services (e.g. DbService, DataTransferService, CloudConnectionStatusService) etc along with info about the dependencies between them?   Obviously I'm particularly interested in resolving the required dependencies for the org.eclipse.kura.core.data.DataServiceImpl  component (22 in console output below).

5) I haven't been able to download/install the mToolkit, and it seems that the kura-equinox_3.8.1.target platform expects to use/startup the mToolkit (in the dev workspace anyway).   Is there some way to work around this (e.g. removing bundles dependent upon the mToolkit lib)?

Thanksinadvance,

Scott

[1] http://stackoverflow.com/questions/33810131/kura-how-to-receive-mqtt-messages-using-the-dataservice
[2] https://www.eclipse.org/kura/downloads.php


---- output from ls and comp commands---

...
osgi> ls
All Components:
ID      State                   Component Name                  Located in bundle
1       Active          com.intel.kurapoc.eventdist.example.producer.MqttDataProducer                   com.intel.kurapoc.eventdist.example.producer(bid=4)
2       Unsatisfied             com.intel.kurapoc.example.dataservicelistener.DataServiceListenerComponent                      com.intel.kurapoc.example.dataservicelistener(bid=9)
3       Registered              org.eclipse.kura.position.PositionService                       org.eclipse.kura.emulator.position(bid=86)
4       Active          org.eclipse.kura.usb.UsbService                 org.eclipse.kura.emulator.usb(bid=87)
5       Unsatisfied             org.eclipse.kura.watchdog.WatchdogService                       org.eclipse.kura.emulator.watchdog(bid=91)
6       Active          org.eclipse.equinox.event                       org.eclipse.equinox.event(bid=98)
7       Active          org.eclipse.kura.core.comm.CommConnectionFactory                        org.eclipse.kura.core.comm(bid=103)
8       Unsatisfied             org.eclipse.kura.deployment.agent                       org.eclipse.kura.deployment.agent(bid=104)
9       Unsatisfied             org.eclipse.kura.status.CloudConnectionStatusService                    org.eclipse.kura.core.status(bid=110)
10      Unsatisfied             org.eclipse.kura.core.cloud.factory.DefaultCloudServiceFactory                  org.eclipse.kura.core.cloud(bid=123)
11      Unsatisfied             org.eclipse.kura.cloud.app.command.CommandCloudApp                      org.eclipse.kura.core.cloud(bid=123)
12      Unsatisfied             org.eclipse.kura.cloud.CloudCallService                 org.eclipse.kura.core.cloud(bid=123)
13      Unsatisfied             org.eclipse.kura.cloud.CloudService                     org.eclipse.kura.core.cloud(bid=123)
14      Registered              org.eclipse.kura.gpio.GPIOService                       org.eclipse.kura.emulator.gpio(bid=136)
15      Active          org.eclipse.kura.crypto.CryptoService                   org.eclipse.kura.core.crypto(bid=144)
16      Active          org.eclipse.kura.certificate.CertificatesService                        org.eclipse.kura.core.certificates(bid=145)
17      Unsatisfied             org.eclipse.kura.clock.ClockService                     org.eclipse.kura.emulator.clock(bid=148)
18      Unsatisfied             org.eclipse.kura.core.configuration.CloudConfigurationHandler                   org.eclipse.kura.core.configuration(bid=152)
19      Unsatisfied             org.eclipse.kura.configuration.ConfigurationService                     org.eclipse.kura.core.configuration(bid=152)
20      Unsatisfied             org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport                     org.eclipse.kura.core(bid=153)
21      Unsatisfied             org.eclipse.kura.system.SystemService                   org.eclipse.kura.core(bid=153)
22      Unsatisfied             org.eclipse.kura.data.DataService                       org.eclipse.kura.core(bid=153)
23      Unsatisfied             org.eclipse.kura.ssl.SslManagerService                  org.eclipse.kura.core(bid=153)
24      Unsatisfied             org.eclipse.kura.db.DbService                   org.eclipse.kura.core(bid=153)
25      Active          org.eclipse.kura.system.SystemAdminService                      org.eclipse.kura.core(bid=153)
26      Unsatisfied             org.eclipse.kura.web.Console                    org.eclipse.kura.web(bid=155)
osgi> comp 22
        Component[
        name = org.eclipse.kura.data.DataService
        activate = activate
        deactivate = deactivate
        modified = updated
        configuration-policy = require
        factory = null
        autoenable = true
        immediate = false
        implementation = org.eclipse.kura.core.data.DataServiceImpl
        state = Unsatisfied
        properties =
        serviceFactory = false
        serviceInterface = [org.eclipse.kura.configuration.ConfigurableComponent, org.eclipse.kura.data.DataService]
        references = {
                Reference[name = DbService, interface = org.eclipse.kura.db.DbService, policy = static, cardinality = 1..1, target = null, bind = setDbService, unbind = unsetDbService]
                Reference[name = DataTransportService, interface = org.eclipse.kura.data.DataTransportService, policy = static, cardinality = 1..1, target = null, bind = setDataTransportService, unbind = unsetDataTransportService]
                Reference[name = CloudConnectionStatusService, interface = org.eclipse.kura.status.CloudConnectionStatusService, policy = static, cardinality = 1..1, target = null, bind = setCloudConnectionStatusService, unbind = unsetCloudConnectionStatusService]
                Reference[name = DataServiceListener, interface = org.eclipse.kura.data.DataServiceListener, policy = dynamic, cardinality = 0..n, target = null, bind = null, unbind = null]
        }
        located in bundle = org.eclipse.kura.core_1.0.9 [153]
]
Dynamic information :
  *The component is NOT satisfied
  The following references are not satisfied:
    Reference[name = DbService, interface = org.eclipse.kura.db.DbService, policy = static, cardinality = 1..1, target = null, bind = setDbService, unbind = unsetDbService]
    Reference[name = DataTransportService, interface = org.eclipse.kura.data.DataTransportService, policy = static, cardinality = 1..1, target = null, bind = setDataTransportService, unbind = unsetDataTransportService]
    Reference[name = CloudConnectionStatusService, interface = org.eclipse.kura.status.CloudConnectionStatusService, policy = static, cardinality = 1..1, target = null, bind = setCloudConnectionStatusService, unbind = unsetCloudConnectionStatusService]
    Reference[name = DataServiceListener, interface = org.eclipse.kura.data.DataServiceListener, policy = dynamic, cardinality = 0..n, target = null, bind = null, unbind = null]
  Component configurations :

osgi>
_______________________________________________
kura-dev mailing list
kura-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/kura-dev

Back to the top