[kura 4.1.0]Problems with CloudSubscriber [message #1807606] |
Tue, 04 June 2019 14:36 |
giuseppe ferro Messages: 34 Registered: August 2016 |
Member |
|
|
Hi all,
I need help.
I'm testing Demo Heater kura bundle.
in particular I want to add.implement and test the CloudSubscriber.
see attached code:
public class Heater implements ConfigurableComponent, CloudSubscriberListener, CloudConnectionListener, CloudDeliveryListener {
.............
private CloudSubscriber cloudSubscriber;
.........
public void setCloudSubscriber(CloudSubscriber cloudSubscriber) {
this.cloudSubscriber = cloudSubscriber;
this.cloudSubscriber.registerCloudSubscriberListener(Heater.this);
this.cloudSubscriber.registerCloudConnectionListener(Heater.this);
}
public void unsetCloudSubscriber(CloudSubscriber cloudSubscriber) {
this.cloudSubscriber.unregisterCloudSubscriberListener(Heater.this);
this.cloudSubscriber.unregisterCloudConnectionListener(Heater.this);
this.cloudSubscriber = null;
}
...........
@Override
public void onMessageArrived(KuraMessage message) {
logReceivedMessage(message);
logger.debug("//////////////// OnReceivedMessage ///////////////////");
}
I have create on kura 4.1.0 one publisher and one subscriber. The topic is the same so i can publish into a topic and "listen" from the same topic.
but i can't read or receive correctly the message published.
I attached the following kura.log:
2019-06-04T14:20:33,249 [] INFO o.e.k.c.d.DataServiceImpl - Storing message on topic: #account-name/#client-id/realtime/command, priority: 7
2019-06-04T14:20:33,256 [] DEBUG o.e.k.c.d.s.DbDataStore - Store message count: 93
2019-06-04T14:20:33,264 [] INFO o.e.k.c.d.DataServiceImpl - Stored message on topic: #account-name/#client-id/realtime/command, priority: 7
2019-06-04T14:20:33,269 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Publishing message with ID: 81398 on topic: #account-name/#client-id/realtime/command, priority: 7
2019-06-04T14:20:33,272 [] INFO o.e.k.d.h.Heater - Published message: org.eclipse.kura.message.KuraPayload@15295e3
2019-06-04T14:20:33,287 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Replaced tokens in topic #account-name/#client-id/realtime/command with: /GK400001116GH1/realtime/command
2019-06-04T14:20:33,291 [DataServiceImpl:Submit] INFO o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: /GK400001116GH1/realtime/command with QoS: 1
2019-06-04T14:20:33,299 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Delivery complete for message with ID: 15863
2019-06-04T14:20:33,302 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.t.m.DataTransportListenerS - No registered listener services. Ignoring onMessageConfirmed
2019-06-04T14:20:33,310 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Published message with ID: 15863
2019-06-04T14:20:33,317 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Published message with ID: 81398 and MQTT message ID: 15863
2019-06-04T14:20:33,319 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.DataServiceImpl - Confirmed message with MQTT message ID: 15863 on session ID: GK400001116GH1-tcp://xxx.xxx.xxx.xxx:1886
2019-06-04T14:20:33,321 [MQTT Call: GK400001116GH1] INFO o.e.k.c.d.DataServiceImpl - Confirmed message ID: 81398 to store
2019-06-04T14:20:33,326 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceListenerS - No registered listener services. Ignoring onMessagePublished
2019-06-04T14:20:33,335 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Suspending publishing thread indefinitely
2019-06-04T14:20:33,339 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.DataServiceListenerS - No registered listener services. Ignoring onMessageConfirmed
2019-06-04T14:20:33,342 [pool-79-thread-4] INFO o.e.k.d.h.Heater - Confirmed message with id: 81398
2019-06-04T14:20:33,346 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Suspending publishing thread indefinitely
2019-06-04T14:20:33,348 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Message arrived on topic: /GK400001116GH1/realtime/command
2019-06-04T14:20:33,350 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.t.m.DataTransportListenerS - No registered listener services. Ignoring onMessageArrived
2019-06-04T14:20:33,352 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.DataServiceImpl - Message arrived on topic: /GK400001116GH1/realtime/command
2019-06-04T14:20:33,354 [MQTT Call: GK400001116GH1] DEBUG o.e.k.c.d.DataServiceListenerS - No registered listener services. Ignoring onMessageArrived
2019-06-04T14:20:33,356 [MQTT Call: GK400001116GH1] INFO o.e.k.c.c.CloudServiceImpl - Message arrived on topic: /GK400001116GH1/realtime/command
2019-06-04T14:20:33,361 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Suspending publishing thread indefinitely
I'm expecting the Logger String on the following Callback
@Override
public void onMessageArrived(KuraMessage message) {
logReceivedMessage(message);
logger.debug("//////////////// OnReceivedMessage ///////////////////");
}
I have attached two pictures of Kura WEB UI configuration
Can someone help me?
thanks a lot
Bye
Giuseppe
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03626 seconds