Closed iamrsaravana closed 3 years ago
It is hard to tell if you did anything wrong without having access to the (device) client side Python code which seems to be in a file called mqtt_publisher_new.py
. Can you provide the content of that file?
import paho.mqtt.client as paho #mqtt library
import os
import json
import time
from datetime import datetime
import threading
import random
from datetime import datetime
#host name is localhost because both broker and python are Running on same
#machine/Computer.
broker="10.109.210.31" #host name , Replace with your IP address.
topic="telemetry";
port=1883 #MQTT data listening port
#ACCESS_TOKEN='M7OFDCmemyKoi461BJ4j' #not manditory
def on_publish(client, userdata, mid):
print("mid: "+str(mid))
def my_publisher(client_name):
# print(client_name)
client1= paho.Client(client_id=client_name) #create client object
client1.on_publish = on_publish #assign function to callback
client1.username_pw_set(username="client_name@LTTS_TENANT", password="devicepassword")
client1.connect(broker,port) #establishing connection
client1.loop_start()
#publishing after every 5 secs
count = 1
while count <11:
payload="{"
payload+="\"DeviceId\":"+"\""+str(client_name)+"@LTTS_TENANT"+"\"";payload+=",";
payload+="\"Temperature\":"+ str(random.randint(0,150));payload+=",";
payload+="\"Humidity\":"+str(random.randint(0,50));payload+=",";
payload+="\"Current_Timestamp\":"+datetime.today().isoformat();payload+=",";
payload+="\"Clientid\":"+"\""+str(client_name)+"\"";
payload+="}"
ret= client1.publish(topic,payload,qos=1) #topic name is test
print(payload);
print("Please check data on your Subscriber Code \n")
time.sleep(5)
count=count+1
start = time.perf_counter()
threads = []
client_names = "Device"
i = 1
print("********************threading started********************")
for _ in range(3):
client_name = client_names + str(i)
# print("clinet"+client_name)
# print(client_names)
t = threading.Thread(target = my_publisher, args= [client_name])
t.start()
threads.append(t)
i = i+1
# print("i alues"+str(i))
for thread in threads:
thread.join()
end = time.perf_counter()
print("********************program ended********************")
print( "no of minutes it tooks" + str(start - end ))
we have checked mqtt broker pod's log which was getting 10 request from python code, but it is not transferring those payload to downstream applications.
First of all: when I run this on my machine against a local Hono 1.7.0-SNAPSHOT deployed to minikube, everything works as expected, i.e. I can see 30 messages being received by the downstream consumer. That said, your code seems to start three clients in parallel, all using the same credentials for connecting. You should not do that. Each device (client) should use its own set of credentials in order to be able to distinguish between them. This is not a big issue when sending telemetry but it will pose an issue when you want to send a command to the device because Hono will then simply route the command to the device that has connected last. Maybe you should start by simplifying your code to use a single thread for starters. Then you could reduce the sleep period to 1 sec and see how you fare. Some questions: Which version of Hono are you using? How did you deploy Hono, are you running in minikube? Which messages do you receive on the consumer side? Is it the first five or is it every second message only? Are you running a single consumer or multiple consumers?
Here's the Python code that I used successfully. It uses the example device that is being created if you use the Hono Helm chart to deploy. You can, of course, also use your own device and adapt username and password accordingly ...
import paho.mqtt.client as paho #mqtt library
import time
import threading
import random
from datetime import datetime
from paho.mqtt.client import connack_string
#host name is localhost because both broker and python are Running on same
#machine/Computer.
broker="10.107.246.97" #host name , Replace with your IP address.
topic="telemetry";
port=1883 #MQTT data listening port
username="sensor1@DEFAULT_TENANT"
password="hono-secret"
#ACCESS_TOKEN='M7OFDCmemyKoi461BJ4j' #not manditory
message_template = """
"Temperature": {0},
"Humidity": {1},
"Current_Timestamp": "{2}"
"""
def on_publish(client, userdata, mid):
print("message [mid: {0}] accepted by server".format(str(mid)))
def on_connect(client, userdata, flags, rc):
print(connack_string(rc))
def publish_messages(client):
count = 1
while count < 11:
payload = "{" + message_template.format(random.randint(0,150), random.randint(0,50), datetime.today().isoformat()) + "}"
ret = client.publish(topic, payload, qos=1)
ret.wait_for_publish()
print("sent message [rc={0}, is published: {1}]: {2}".format(ret.rc, ret.is_published(), payload))
print("Please check data on your Subscriber Code \n")
count=count+1
time.sleep(1)
client.loop_stop(False)
client.disconnect()
def my_publisher(client_name):
# print(client_name)
client1= paho.Client(client_id=client_name) #create client object
client1.on_publish = on_publish #assign function to callback
client1.on_connect = on_connect
client1.username_pw_set(username, password)
client1.loop_start()
client1.connect(broker, port) #establishing connection
publish_messages(client1)
start = time.perf_counter()
threads = []
client_names = "Device"
i = 1
print("********************threading started********************")
for _ in range(1):
client_name = client_names + str(i)
# print("clinet"+client_name)
# print(client_names)
t = threading.Thread(target = my_publisher, args= [client_name])
t.start()
threads.append(t)
i = i+1
# print("i alues"+str(i))
for thread in threads:
thread.join()
end = time.perf_counter()
print("********************program ended********************")
print( "no of seconds it took: " + str(end - start))
Can you confirm that this works for you as well?
Which version of Hono are you using? we are using 1.5.0 How did you deploy Hono, are you running in minikube? we installed it in k8s Which messages do you receive on the consumer side? Is it the first five or is it every second message only? publishing Input: Connection Accepted. message [mid: 1] accepted by server sent message [rc=0, is published: True]: { "Temperature": 93, "Humidity": 18, "Current_Timestamp": "2021-03-31T09:50:19.627283" } Please check data on your Subscriber Code
message [mid: 2] accepted by server sent message [rc=0, is published: True]: { "Temperature": 49, "Humidity": 2, "Current_Timestamp": "2021-03-31T09:50:21.864672" } Please check data on your Subscriber Code
message [mid: 3] accepted by server sent message [rc=0, is published: True]: { "Temperature": 43, "Humidity": 2, "Current_Timestamp": "2021-03-31T09:50:22.924230" } Please check data on your Subscriber Code
message [mid: 4] accepted by server sent message [rc=0, is published: True]: { "Temperature": 95, "Humidity": 12, "Current_Timestamp": "2021-03-31T09:50:23.933834" } Please check data on your Subscriber Code
message [mid: 5] accepted by server sent message [rc=0, is published: True]: { "Temperature": 101, "Humidity": 18, "Current_Timestamp": "2021-03-31T09:50:24.944400" } Please check data on your Subscriber Code
message [mid: 6] accepted by server sent message [rc=0, is published: True]: { "Temperature": 17, "Humidity": 31, "Current_Timestamp": "2021-03-31T09:50:25.955030" } Please check data on your Subscriber Code
message [mid: 7] accepted by server sent message [rc=0, is published: True]: { "Temperature": 19, "Humidity": 14, "Current_Timestamp": "2021-03-31T09:50:26.964019" } Please check data on your Subscriber Code
message [mid: 8] accepted by server sent message [rc=0, is published: True]: { "Temperature": 108, "Humidity": 0, "Current_Timestamp": "2021-03-31T09:50:27.976700" } Please check data on your Subscriber Code
message [mid: 9] accepted by server sent message [rc=0, is published: True]: { "Temperature": 111, "Humidity": 32, "Current_Timestamp": "2021-03-31T09:50:28.986561" } Please check data on your Subscriber Code
message [mid: 10] accepted by server sent message [rc=0, is published: True]: { "Temperature": 12, "Humidity": 26, "Current_Timestamp": "2021-03-31T09:50:30.002458" } Please check data on your Subscriber Code
consumer output: Looks like it is fetching second alternative messages. root@master-node1:/home/rsa-key-dev-nodes/vasanth# java -jar hono-cli-1.6.*.jar --hono.client.host=10.97.217.229 --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver --tenant.id=LTTS_TENANT
____ | (_) | __ ___ | __ | __ | ___ | __ | / __ | '_ \/ __ | / _ \ | __ | / _ \ | ' \ / \ | ___ | (__ | ) _ \ __/ | (_) | (_) | _____ | _ | _ | .__/ | /\ | _ | _ | ___/ | _ | _ | ___/ | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
_ |
Eclipse Hono Example Client (v1.6.0) using Spring Boot (v2.2.11.RELEASE)
Go to https://www.eclipse.org/hono for more information.
09:47:11.247 [main] INFO org.eclipse.hono.cli.Application - Starting Application v1.6.0 on master-node1 with PID 5383 (/home/rsa-key-dev-nodes/vasanth/hono-cli-1.6.0-exec.jar started by root in /home/rsa-key-dev-nodes/vasanth) 09:47:11.254 [main] INFO org.eclipse.hono.cli.Application - The following profiles are active: receiver 09:47:12.893 [main] INFO org.eclipse.hono.cli.Application - running command line client in role(s): receiver 09:47:14.299 [main] INFO org.eclipse.hono.cli.Application - Started Application in 5.796 seconds (JVM running for 9.051) 09:47:15.790 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - Receiver [tenant: LTTS_TENANT, mode: all] created successfully, hit ctrl-c to exit 09:50:21.919 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - received telemetry message [device: Device1, content-type: application/octet-stream]: { "Temperature": 49, "Humidity": 2, "Current_Timestamp": "2021-03-31T09:50:21.864672" } 09:50:21.920 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - ... with application properties: {orig_adapter=hono-mqtt, qos=1, device_id=Device1, orig_address=telemetry} 09:50:23.940 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - received telemetry message [device: Device1, content-type: application/octet-stream]: { "Temperature": 95, "Humidity": 12, "Current_Timestamp": "2021-03-31T09:50:23.933834" } 09:50:23.940 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - ... with application properties: {orig_adapter=hono-mqtt, qos=1, device_id=Device1, orig_address=telemetry} 09:50:25.960 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - received telemetry message [device: Device1, content-type: application/octet-stream]: { "Temperature": 17, "Humidity": 31, "Current_Timestamp": "2021-03-31T09:50:25.955030" } 09:50:25.960 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - ... with application properties: {orig_adapter=hono-mqtt, qos=1, device_id=Device1, orig_address=telemetry} 09:50:27.982 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - received telemetry message [device: Device1, content-type: application/octet-stream]: { "Temperature": 108, "Humidity": 0, "Current_Timestamp": "2021-03-31T09:50:27.976700" } 09:50:27.983 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - ... with application properties: {orig_adapter=hono-mqtt, qos=1, device_id=Device1, orig_address=telemetry} 09:50:30.009 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - received telemetry message [device: Device1, content-type: application/octet-stream]: { "Temperature": 12, "Humidity": 26, "Current_Timestamp": "2021-03-31T09:50:30.002458" } 09:50:30.009 [vert.x-eventloop-thread-0] INFO org.eclipse.hono.cli.app.Receiver - ... with application properties: {orig_adapter=hono-mqtt, qos=1, device_id=Device1, orig_address=telemetry}
Are you running a single consumer or multiple consumers?
we are using single consumer.
Looks like 1.7.0 version yet to publish in helm. are you building images from source code?
Maybe you can add the message count to the messages being sent like this:
...
message_template = """
"Count": {3},
"Temperature": {0},
"Humidity": {1},
"Current_Timestamp": "{2}"
"""
...
def publish_messages(client):
count = 1
while count < 11:
payload = "{" + message_template.format(random.randint(0,150), random.randint(0,50), datetime.today().isoformat(), count) + "}"
ret = client.publish(topic, payload, qos=1)
ret.wait_for_publish()
print("sent message [rc={0}, is published: {1}]: {2}".format(ret.rc, ret.is_published(), payload))
print("Please check data on your Subscriber Code \n")
count=count+1
time.sleep(1)
client.loop_stop(False)
client.disconnect()
....
we can then see, which messages are coming through to the downstream consumer
in pod log file: kubectl logs pod/eclipse-hono-adapter-mqtt-vertx-6c795675d9-4l6dc -n hono -c eclipse-hono-adapter-mqtt-vertx
i can see it receiving 10 inputs from publisher
10:28:33.208 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - connection request from client [client-id: Device1] 10:28:33.208 [vert.x-eventloop-thread-0] DEBUG o.e.h.s.auth.device.ChainAuthHandler - using UsernamePasswordAuthProvider 10:28:33.208 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - creating new client for [tenant] 10:28:33.208 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.TenantClientImpl - creating new tenant client 10:28:33.208 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - enabling caching of responses from tenant 10:28:33.212 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - receiver open [source: tenant/b2285071-2db3-4a19-bb9f-fe46338b1343] 10:28:33.215 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - sender open [target: tenant, sendQueueFull: false, remote max-message-size: null] 10:28:33.215 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - request-response client for peer [eclipse-hono-service-device-registry] created 10:28:33.215 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.TenantClientImpl - successfully created tenant client 10:28:33.215 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - successfully created new client for [tenant] 10:28:33.217 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - sent request [target address: tenant, subject: get, correlation ID: tenant-client-1fe0fcdb-1848-404b-bb0e-0367dd14440e] to service 10:28:33.227 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - received response [reply-to: tenant/b2285071-2db3-4a19-bb9f-fe46338b1343, subject: null, correlation ID: tenant-client-1fe0fcdb-1848-404b-bb0e-0367dd14440e, status: 200, cache-directive: max-age = 180] 10:28:33.227 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:33.227 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - creating new client for [credentials/LTTS_TENANT] 10:28:33.227 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CredentialsClientImpl - creating new credentials client for [LTTS_TENANT] 10:28:33.228 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - enabling caching of responses from credentials 10:28:33.230 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - receiver open [source: credentials/LTTS_TENANT/f77f1403-1f37-4679-9a91-2a0aec778d87] 10:28:33.234 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - sender open [target: credentials/LTTS_TENANT, sendQueueFull: false, remote max-message-size: null] 10:28:33.235 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - request-response client for peer [eclipse-hono-service-device-registry] created 10:28:33.235 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CredentialsClientImpl - successfully created credentials client for [LTTS_TENANT] 10:28:33.236 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - successfully created new client for [credentials/LTTS_TENANT] 10:28:33.238 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - sent request [target address: credentials/LTTS_TENANT, subject: get, correlation ID: cred-client-7ee9770a-2124-452b-afc6-a6527d6c03ea] to service 10:28:33.247 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - received response [reply-to: credentials/LTTS_TENANT/f77f1403-1f37-4679-9a91-2a0aec778d87, subject: null, correlation ID: cred-client-7ee9770a-2124-452b-afc6-a6527d6c03ea, status: 200, cache-directive: max-age = 180] 10:28:33.253 [vert.x-worker-thread-3] DEBUG o.e.h.s.a.d.UsernamePasswordAuthProvider - validating password hash on vert.x worker thread [vert.x-worker-thread-3] 10:28:33.367 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:33.368 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:33.369 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - creating new client for [registration/LTTS_TENANT] 10:28:33.370 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.RegistrationClientImpl - creating new registration client for [LTTS_TENANT] 10:28:33.370 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - enabling caching of responses from registration 10:28:33.375 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - receiver open [source: registration/LTTS_TENANT/f1b4e6a1-7927-4e78-8c4b-78f20d223b2c] 10:28:33.379 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.HonoConnectionImpl - sender open [target: registration/LTTS_TENANT, sendQueueFull: false, remote max-message-size: null] 10:28:33.379 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - request-response client for peer [eclipse-hono-service-device-registry] created 10:28:33.379 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.RegistrationClientImpl - successfully created registration client for [LTTS_TENANT] 10:28:33.379 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - successfully created new client for [registration/LTTS_TENANT] 10:28:33.380 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - sent request [target address: registration/LTTS_TENANT, subject: assert, correlation ID: reg-client-2af1404a-e8e6-4404-b4c8-aeb080a91d10, device ID: Device1] to service 10:28:33.391 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.i.AbstractRequestResponseClient - received response [reply-to: registration/LTTS_TENANT/f1b4e6a1-7927-4e78-8c4b-78f20d223b2c, subject: null, correlation ID: reg-client-2af1404a-e8e6-4404-b4c8-aeb080a91d10, status: 200, cache-directive: max-age = 300] 10:28:33.392 [vert.x-eventloop-thread-0] INFO o.e.h.s.m.LoggingConnectionEventProducer - Connected - ID: Device1, Protocol Adapter: hono-mqtt, Device: device [device-id: Device1, tenant-id: LTTS_TENANT], Data: null 10:28:33.393 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:33.394 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:33.394 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:33.394 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:33.395 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:33.395 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:34.404 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:34.404 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:34.404 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:34.405 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:34.405 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:34.405 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:35.412 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:35.413 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:35.413 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:35.414 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:35.414 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:35.415 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:36.421 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:36.422 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:36.422 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:36.422 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:36.422 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:36.423 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:37.428 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:37.429 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:37.429 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:37.429 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:37.430 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:37.430 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:38.442 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:38.442 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:38.443 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:38.443 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:38.443 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:38.444 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:39.466 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:39.466 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:39.466 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:39.467 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:39.467 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:39.467 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:40.477 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:40.478 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:40.478 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:40.478 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:40.479 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:40.479 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:41.489 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:41.490 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:41.491 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:41.491 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:41.491 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:41.491 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:42.498 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:42.499 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.HttpBasedMessageMapping - no payload mapping configured for device [device-id: Device1, tenant-id: LTTS_TENANT] 10:28:42.501 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [tenant] 10:28:42.501 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [registration/LTTS_TENANT] 10:28:42.502 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - protocol adapter [hono-mqtt] is enabled for tenant [LTTS_TENANT] 10:28:42.502 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.CachingClientFactory - reusing cached client [telemetry/LTTS_TENANT] 10:28:43.509 [vert.x-eventloop-thread-0] INFO o.e.h.s.m.LoggingConnectionEventProducer - Disconnected - ID: Device1, Protocol Adapter: hono-mqtt, Device: device [device-id: Device1, tenant-id: LTTS_TENANT], Data: null 10:28:43.510 [vert.x-eventloop-thread-0] DEBUG o.e.h.a.m.i.VertxBasedMqttProtocolAdapter - connection to device [tenant-id: LTTS_TENANT, device-id: Device1] closed root@master-node1:/home/rsa-key-dev-nodes#
those 10 payload values are not coming both hono-cli command and AMPQ connector.
What is the AMQP connector?
I meant dispatch router.
Can you please provide the output of both the Python sender and the hono-cli?
It was our mistake one consumer was running in the background, because of that we are getting only half of the records are coming.
Glad it works for you as well :-) Can you close this issue then?
yes please.
Dear Committer,
We are sending data through MQTT client which is pushing data into hono mqtt adapter
Here below python code sending 10 payloads to hono: root@worker-node3:/projects# python3 mqtt_publisher_new.py ****threading started**** {"DeviceId":"Device1@LTTS_TENANT","Temperature":96,"Humidity":30,"Current_Timestamp":2021-03-30T10:31:06.484741,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 1 {"DeviceId":"Device1@LTTS_TENANT","Temperature":3,"Humidity":5,"Current_Timestamp":2021-03-30T10:31:11.489595,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 2 {"DeviceId":"Device1@LTTS_TENANT","Temperature":30,"Humidity":42,"Current_Timestamp":2021-03-30T10:31:16.493894,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 3 {"DeviceId":"Device1@LTTS_TENANT","Temperature":105,"Humidity":33,"Current_Timestamp":2021-03-30T10:31:21.497854,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 4 {"DeviceId":"Device1@LTTS_TENANT","Temperature":9,"Humidity":50,"Current_Timestamp":2021-03-30T10:31:26.502771,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 5 {"DeviceId":"Device1@LTTS_TENANT","Temperature":47,"Humidity":20,"Current_Timestamp":2021-03-30T10:31:31.507097,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 6 {"DeviceId":"Device1@LTTS_TENANT","Temperature":59,"Humidity":35,"Current_Timestamp":2021-03-30T10:31:36.512465,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 7 {"DeviceId":"Device1@LTTS_TENANT","Temperature":46,"Humidity":39,"Current_Timestamp":2021-03-30T10:31:41.513799,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 8 {"DeviceId":"Device1@LTTS_TENANT","Temperature":103,"Humidity":15,"Current_Timestamp":2021-03-30T10:31:46.519210,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 9 {"DeviceId":"Device1@LTTS_TENANT","Temperature":53,"Humidity":5,"Current_Timestamp":2021-03-30T10:31:51.524286,"Clientid":"Device1"} Please check data on your Subscriber Code
mid: 10 ****program ended**** no of minutes it tooks-50.049262598000496
other side(North side) we are using Hono-Cli Jar files try to read those payloads. but cli command giving only 5 records as a output. we could test/source for dispatch router. could you help us to provide code or testing tools to identify where exactly those records are missing.