eclipse-hono / hono

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

Address rewrite setting not used for all addresses #3625

Open djairhogeuens opened 7 months ago

djairhogeuens commented 7 months ago

When trying to use the addressRewriteRule setting, it seems this doesn't work on all addresses.

As far as I can see, the telemetry/{tenantId} and event/{tenantId} addresses are correctly rewrite while the notification/... and command_internal/... addresses remaing unchanged. Not sure if other addresses are also affected.

A first look into the code seems to indicate that the AddressHelper as defined in https://github.com/eclipse-hono/hono/blob/master/clients/amqp-connection/src/main/java/org/eclipse/hono/client/amqp/config/AddressHelper.java is used for some addresses but not for all of them (like here https://github.com/eclipse-hono/hono/blob/master/clients/command-amqp/src/main/java/org/eclipse/hono/client/command/amqp/ProtonBasedInternalCommandSender.java).

I'm very new to Hono and definitely not experienced in the code base so my first root cause analysis might be incorrect.

We're trying to implement Hono with an external AMQP broker which requires that our addresses get a prefix as the broker is also used by other applications.

I'd appreciate if someone could help me out.

sophokles73 commented 7 months ago

This might indeed be true. The notification mechanism has been added quite after the initial telemetry and event addresses. We would be happy to receive a corresponding PR :-)