Open mludvig opened 4 years ago
you look like you're missing "try_private false"
Thanks, just tried both try_private false
and try_private true
and it doesn't help. Still getting Socket error ...
AWS does not support Retained messages but you are publishing a retained message:
1572821604: Received PUBLISH from mosq-f2AcX35ovhb4OmJOhC (d0, q0, r1, m0, 'xyz/test', ... (73 bytes))
1572821604: Sending PUBLISH to local.xyz.test_mosquitto_org (d0, q0, r1, m0, 'xyz/test', ... (73 bytes))
1572821604: Sending PUBLISH to local.xyz.awsiot (d0, q0, r1, m0, 'xyz/test', ... (73 bytes))
https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html
This is same with Google IoT, see https://cloud.google.com/iot/docs/requirements#mqtt_bridge.
Thanks you’re right, publishing without retain flag works. Unfortunately we need the messages retained on the primary broker.
Is there any way to clear the flag before forwarding it to AWS or Google?
@mludvig Not in released versions, but this does what you need: https://github.com/eclipse/mosquitto/commit/2af260ba58afc4055bbbc3710f8662dcec92ff22
@ralight seems like this commit was never merged in the later versions after it. Do you know if there is at this time a workaround?
@ralight seems like this commit was never merged in the later versions after it. Do you know if there is at this time a workaround?
I'm also running into this issue. It would be really useful to have this forgotten feature integrated.
I just stumbled upon this as well. Given I'm not a developer and there's no released version of this means I'd have to go back to the actual devices to manage retain.
The option of turning this off completely or even by topic would be a great addition to the broker. However I'm not sure what's involved or whether there is demand for this.
@mludvig are you saying bridging your main broker to (remote) Mosquitto works even with messages containing retain=yes? If yes, my workaround may have to be to run an instance of Mosquitto on say AWS or check out the IBM Watson IoT service.
As the topic is still open, posting for those who will be looking for similar info about "retain".
Changelog for v2.0.0 (https://mosquitto.org/ChangeLog.txt) mentions:
"- Add bridge_outgoing_retain
option, to allow outgoing messages from a
bridge to have the retain bit completely disabled, which is useful when
bridging to e.g. Amazon or Google."
I'm trying to bridge a local broker to two remote brokers - one is Mosquitto based and the second one is AWS IoT. For some reason the connection to AWS IoT keeps closing all the time with
Socket error on client local.xyz.awsiot, disconnecting.
. The Mosquitto connection works well.Here is my sample
mosquitto.conf
...When I start
mosquitto
with this config it seems to connect to both endpoints:However as soon as I publish a message to the local broker the AWS IoT connection starts crashing:
I'm pretty sure it's not the AWS IoT configuration or the SSL certificates because with
mosquitto_pub
with the same certs I can submit messages to AWS IoT.I'm using the latest mosquitto 1.6.7 on Linux Mint 19.1 and on Ubuntu 18.04, getting the same issue.