Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Configuration of bridge on both directions

Hi Marcelo,

Great, I'm glad to hear you got it sorted.



On Tue, Apr 15, 2014 at 1:33 PM, Marcelo Diniz <marudiniz@xxxxxxxxx> wrote:
> Hello Roger and all,
> I see, so the issue was the way I was simulating the connection loss (with
> kill -9).
> I did a setup with brokers running in two different machines and then I
> disconnected them (by pulling the cable). After reconnecting and waiting for
> the bridge to be up again, the messages were delivered to the remote broker.
> I'm using QoS 2 for the tests just to make sure it works but, as you
> mentioned, any QoS > 0 should work because it's queued locally.
> I'll update the bug so people won't be mislead.
> Thank you
> Marcelo Diniz
> Em Quarta-feira, 9 de Abril de 2014 20:36, Roger Light <roger@xxxxxxxxxx>
> escreveu:
> Hi Marcelo,
> Sorry for not replying earlier, I've been a bit busy. I've now replied
> to the bug directly with the conclusion that you need to subscribe to
> the bridging broker with mosquitto_sub with clean session set to
> false,  using qos>0 and if you kill the bridging broker with -9 then
> it doesn't have chance to write the persistence file out and hence
> won't remember any subscriptions when you restart.
> Let us know if that is the problem!
> Cheers,
> Roger
> On Mon, Apr 7, 2014 at 10:10 AM, Marcelo Diniz <marudiniz@xxxxxxxxx> wrote:
>> Hello
>> I'm looking at MQTT for a way to reliably deliver messages between brokers
>> (both directions), with message queuing when the connection goes down.
>> From
>> other threads I read this is is a covered use case, but I haven't found a
>> way to configure it correctly so some guidance would be helpful.
>> Scenario: server and clients run each a local MQTT broker (mosquitto).
>> Brokers in the clients are configured as bridges, connecting to the
>> server.
>> Client configuration is below:
>> connection bridge_123
>> clientid client_123
>> address localhost:1883
>> topic mosquittodemo/test both 2
>> cleansession false
>> The broker in the server is not configured as bridge.
>> Server and clients can go offline at any time, and messages should be
>> queued
>> locally when the connection is down. Messages are sent in both directions.
>> The server sends messages to a given client by publishing on a topic only
>> the client is listening (not in the config above).
>> I'm running a server and client on different ports to test the queuing
>> when
>> the connection is down. Then there are these two cases:
>> 1. I kill the broker on the server, and continue sending messages to the
>> client broker (which are queued). Then I restart the broker on the server,
>> and after the bridge is reestablished the queued messages are delivered.
>> So
>> queuing works when sending messages client -> server.
>> 2. I kill the broker on the client, and continue sending messages to the
>> server broker (which should get queued). Then I restart the broker on the
>> client. The bridge is reestablished but the old messages are not
>> delivered.
>> New messages are delivered as expected.
>> So it seems the queuing is not working on the other side of the bridge, on
>> the broker that was not configured as a bridge.
>> Is my configuration wrong? Is this use case supported? Or is my way of
>> testing (killing brokers with kill -9 to simulate a broken connection)
>> that
>> is not appropriate?
>> If it matters: I'm using mosquitto_sub and mosquitto_pub to publish and
>> subscribe to topics.
>> Thank you,
>> Marcelo
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx

Back to the top