Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:56
    calohmn edited #3384
  • 13:25
    calohmn assigned #3379
  • 13:24
    calohmn commented #3379
  • 13:19
    calohmn milestoned #3384
  • 13:19
    calohmn labeled #3384
  • 13:19
    calohmn review_requested #3384
  • 13:19
    calohmn milestoned #3384
  • 13:19
    calohmn labeled #3384
  • 13:19
    calohmn opened #3384
  • 13:16
    calohmn labeled #3379
  • 13:16
    calohmn labeled #3379
  • Aug 17 15:06
    kduba synchronize #3382
  • Aug 17 13:31
    calohmn milestoned #3382
  • Aug 17 13:31
    calohmn milestoned #3382
  • Aug 17 13:31
    calohmn labeled #3382
  • Aug 17 13:31
    calohmn labeled #3382
  • Aug 17 07:43
    calohmn review_requested #3383
  • Aug 17 07:43
    calohmn review_requested #3383
  • Aug 17 07:43
    calohmn milestoned #3383
  • Aug 17 07:43
    calohmn milestoned #3383
Julian
@JulianFeinauer
I think I do everything similar but my message gets rejected and I have no idea why
Julian
@JulianFeinauer
From the log of the command router I see: command message has no valid address but the to property of my message seems to be correct and the sender link also...
Kai Hudalla
@sophokles73
Maybe you want to share your Python code?
Julian
@JulianFeinauer
Sure
This is my testing script (attention, its rather „Holzhacker“-Programming)
But its based on the python code I did for the hono quickstart Demo I did back then
I guess the crucial part is here
    def on_start(self, event):
        event.container: Container
        conn = event.container.connect(url=self.server, user="consumer@HONO", password="verysecret")

        event.container.create_receiver(conn, f"telemetry/{self.tenant}")
        self.sender = event.container.create_sender(conn, target=f"command/{self.tenant}", options=[HelloWorld.SessionEnd()])

    def on_message(self, event):
        print(f"I got a telemetry message, sending command...")
        self.accept(event.delivery)
        message = Message(properties={
            "to": f"command/{self.tenant}/{self.deviceId}",
            "subject": "work",
            # "content-type": "application/json",
            # "messageId": "0",
            # "userId": "null",
            # "replyTo": "null",
            # "correlationId": "0",
            # "contentEncoding": "null",
            # "absoluteExpiryTime": "null",
            # "creationTime": "null",
            # "groupId": 'null',
            # "groupSequence": "null",
            # "replyToGroupId": 'null',
        })
        print(f"Sending Command: {message}")
        self.sender.send(message)
Kai Hudalla
@sophokles73
it should probably be "to:" f"command/{self.tenantId}/{self.deviceId}", shouldn't it?
Kai Hudalla
@sophokles73
ah no, I see, tenant is initialized to the value of tenantId ...
Kai Hudalla
@sophokles73
@JulianFeinauer I am using this code to (successfully) send a command to a device via the HTTP adapter. Maybe you can adapt your code accordingly?
from __future__ import print_function, unicode_literals
from proton import Message
from proton.handlers import MessagingHandler
from proton.reactor import Container

class HelloWorld(MessagingHandler):
    def __init__(self, server, address):
        super(HelloWorld, self).__init__()
        self.server = server
        self.address = address

    def on_start(self, event):
        print("connecting ...")
        conn = event.container.connect(self.server, sasl_enabled=True, allowed_mechs="PLAIN", allow_insecure_mechs=True, user="consumer@HONO", password="verysecret")
        event.container.create_sender(conn, self.address)

    def on_sendable(self, event):
        print("sending command")
        event.sender.send(Message(body="Hello World!", address="command/DEFAULT_TENANT/4711", content_type="text/plain", subject="call"))
        event.sender.close()
        event.connection.close()

Container(HelloWorld("amqp://hono.eclipseprojects.io:15672", "command/DEFAULT_TENANT")).run()
maybe you need to use "address" instead of "to"?
Julian
@JulianFeinauer
Yeah, thanks @sophokles73 , I got it working with your example
Indeed I guess it was me using the lib incorrectly. with your handling of properties it works with mine it doesnt
Kai Hudalla
@sophokles73
Nice :-)
@/all I will start the 1.8.3 build now ...
Julian
@JulianFeinauer
I never used AMQP before so please excuse my noob questions : )
Kai Hudalla
@sophokles73
no sweat, it is not that popular anyway so you are part of the majority ;-)
Julian
@JulianFeinauer
But I think the documentation could be improved a bit then… from my understanding the address is a fixed AMQP attribute of a message, right?
Kai Hudalla
@sophokles73
fixed?
Julian
@JulianFeinauer
I got a bit confused since I passed the „to“ and „subject“ as Message Properties to QPid (as read from the Hono docs) but it seems that qpid at least likes to have the explicit attributes „address“ and „subject“ to work
So i thought it might be „special“ fixed properties but it seems thats just an issue of qpid and not of Hono
From my understanding, it should be a valid AMQP message if I pass a properties dict with keys to and subject but it seems that qpid wants it as separate properties address and subject directly (see here: https://qpid.apache.org/releases/qpid-proton-0.32.0/proton/python/docs/proton.html#proton.Message)
Julian
@JulianFeinauer
Another question regarding the command and control API from HONO. If the application wants to send a command to a device… it needs to implement a strategy to basically „retry“ it until it gets an answer accepted (and even if that, in case of one-way it needs to hope that it worked). Or is there anything more „intelligent“ that works with all adapters (in case of HTTP it could simply react to a message received event with a ttd set
Kai Hudalla
@sophokles73
The "ttd" mechanism works for all protocol adapters. See https://www.eclipse.org/hono/docs/1.8/concepts/device-notifications/ An application simply need to check the ttd application property in messages from devices in order to determine if the device can currently accept commands ...
Julian
@JulianFeinauer
okay.. so in most cases I would „piggybag“ my commands to send them after I received telemetry data
But I just discovered the command router API which should be some kind of generalization of this idea, right?
Kai Hudalla
@sophokles73
it depends. If a device maintains a permanent subscription for commands, e.g. using MQTT or AMQP 1.0, then your application can send commands at any time after it has received a notification containing a ttd value of -1 and before receiving a message with ttd = 0. For devices using stateless protocols like HTTP or CoAP, the application can send commands after it has received a message containing a ttd > 0 and before the ttd has been reached ...
Julian
@JulianFeinauer
I see
But generally speaking I should implement some kind of „mailbox“ mechanism in my app that „buffers“ the commands (if they are NOT ephemeral)
Kai Hudalla
@sophokles73
yes, Hono does not provide such an outbox for each device.
Julian
@JulianFeinauer
got it, thanks
Slowly I start to see how we would need to modify our application to get it working on HONO
Julian
@JulianFeinauer
And regarding the relation of Hono and EnMasse… in a scalable setup we would use an EnMasse „controlled“ infrastructure as Broker and Dispatcher and not the single containers provided with the Helm Chart?
Kai Hudalla
@sophokles73
That's the idea, yes. However, we are currently implementing support for using Apache Kafka as an alternative messaging infrastructure (i.e. replacing Dispatch Router and Artemis). This is already available in Hono 1.9 as a tech preview and I guess in the upcoming 1.10.0 version we will declare this fully supported ...
Julian
@JulianFeinauer
Ah, so all communication woudl then be done via Kafka Topics basically?
Kai Hudalla
@sophokles73
Julian
@JulianFeinauer
yes, I saw it in the docu but did not have a deeper look. What about the internal APIs? Would these still be AMQP?
Kai Hudalla
@sophokles73
If by "internal" you mean between protocol adapters and device registry, then the answer is yes. However, these components talk to each other directly, i.e. they do not need the Dispatch Router ...
9 replies
Kai Hudalla
@sophokles73
@/all I am now starting the 1.9.1 release build ...
Kai Hudalla
@sophokles73
@/all 1.8.3 and 1.9.1 have been released successfully ... The Hono helm chart has also already been updated accordingly
Anoop Kumar
@anoopk30
Hello, I want to know whether we can connect Eclipse Hono with Eclipse Kapua along with Eclipse Kura?
Bob Claerhout
@BobClaerhout
Hi all, I've question concerning the quarkus images. Some time ago I noticed the quarkus images didn't do what I expected. Yesterday I installed the latest hono version on our test cluster and the quarkus images were used automatically. However, it seems some configuration is not passed to the container. I can't seem to find where the configuration (in code) is coming from. I found QuarkusMqttProtocolAdapterProperties but couldn't find where this was populated. Do I have to provide the configuration in a different way for these quarkus containers?
17 replies
Julian
@JulianFeinauer
Short feedback after all my struggle with the initial setup and getting everything right in my tooling we finally start to use Hono and really like it. Very well done guys (special thanks to @sophokles73 for all the help). I try to prepare a little PR with some minor updates in the documentation (things that confused me) to help others to ease their „onboarding"
Kai Hudalla
@sophokles73
@JulianFeinauer thanks for the feedback :-) A PR would be more than welcome ... Would you also mind sharing some details about your use case/scenario where you are deploying Hono?
Julian
@JulianFeinauer
@sophokles73 Of course. We have a SaaS Offering for Machine Builders (not Factories) where we give them their own whitelabeled „Portal“ to communicate with their machines as well as their clients. So one part of the system is a little bit like the Azure IoTHUB / Boschs IoT Suite but more focused on Metadata and their relation with the Machine and so on. Another crucial part for us is the data history so we rely heavily on Apache IoTDB (there were / are also discussions in the #eclipse/ditto channel about some possibilities to integrate timeseries storage with Ditto in some way)
But simply put.. we have gateways that read data from machinery (a bit like Kura) and sends them via Messaging (currently MQTT only) to our backend where we then do several things with it
And we now decided to migrate to Hono for simple scaling reasons. Not about the infrastructure but the device management as our customer base (luckily) grows : )
Kai Hudalla
@sophokles73
Awesome. Thanks @JulianFeinauer :-)
Dejan Bosanac
@dejanb
@calohmn @sophokles73 Just got the confirmation that Quarkus 2.2.x is ready and productized and will be supported long term ... Next productized version will be 2.2.3