Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Remove leading slash in topic name in bridge remapping

Hi Matt,

I want to remove the leading slash; I have read that it is not a good practice to have it, but I am dealing with a legacy system, so I am trying to find a workaround.

This is the desired scenario:

local topic: /test/sensor/+
remote topic: test/sensor
config entry: topic test/sensor/+ out "/" ""

When I try it, Mosquitto starts without errors, however it does not send the data to the remote broker. I tested this with tcpdump, which shows me outgoing traffic towards the remote host.

However, for the config entry `topic /test/sensor/+ out "/" ""` something is sent to the remote broker, but it retains the leading slash, here is the raw data from the sniffer, to illustrate my point:


       0x0000:  4500 0054 1d52 4000 4006 81d7 c0a8 0d21  E..T.R@.@......!
        0x0010:  c0a8 0d09 9f56 075d 159c 08d0 0a97 dd8a  .....V.]........
        0x0020:  8018 00e5 9bc1 0000 0101 080a 0d60 81b2  .............`..
        0x0030:  a815 1960 301e 0013 2f74 6573 742f 7365  ...`0.../test/se
        0x0040:  6e73 6f72 2f30 3030 3030 3361 6161 6161  nsor/000003aaaaa
        0x0050:  6161 6161                                aaaa



Alex

Back to the top