eclipse-hono / hono

Eclipse Hono™ Project
https://eclipse.dev/hono
Eclipse Public License 2.0
453 stars 137 forks source link

How to send specific headers when using hono-ditto kafka connector and map headers when using MQTT - adapter at device end #3649

Closed srinivaschannakeshava closed 4 months ago

srinivaschannakeshava commented 5 months ago

Trying to map device events to update connection status and receiving this error at ditto consumption -

2024-06-21 11:52:56 2024-06-21 06:22:56,976 INFO [][] o.e.d.c.s.m.ConnectionStatusMessageMapper - Error occurred during mapping: <MessageMappingFailedException>: Header <ttd> is not set.

  1. Also is there a way to enable connection and disconnection events to be published on kafka from MQTT adapter in Hono?
  2. If there needs to be custom headers that needs to be added on the kafka published message - how can this be enabled when using mqtt-adapter ?
sophokles73 commented 4 months ago

ad 1) see https://eclipse.dev/hono/docs/admin-guide/mqtt-adapter-config/#service-configuration The hono.connectionEvents.producer propery needs to be set to events in order to have the adapter emit connection events.

ad 2) see https://eclipse.dev/hono/docs/user-guide/mqtt-adapter/#adding-meta-data