MQTT updates are not frequent as HTTP url forward

alexsahka2 years ago

What is wrong with MQTT forward config?

Forwarding to HTTP with no problem, but MQTT skipping a lot of events and positions.
Here are my two configs HTTP and MQTT

Thank you.

<!-- position forwarding -->
<entry key='forward.enable'>true</entry>
<entry key='forward.type'>json</entry>
<entry key='forward.url'>http://IP/traccar/api</entry>
<entry key='event.forward.enable'>true</entry>
<entry key='event.forward.url'>http://IP/traccar/api</entry>
<!-- MQTT forwarding -->
<entry key='event.forward.type'>mqtt</entry>
<entry key='event.forward.url'>mqtt://user:pass@IP:1883</entry>
<entry key='event.forward.topic'>traccar/events</entry>
Anton Tananaev2 years ago

You don't have any position forwarding with MQTT.

As for events, if some are missing, there's probably an error. Check logs.

alexsahka2 years ago

Anton, is this is correct MQTT config?
Thank you.

<!-- MQTT forwarding -->
<entry key='forward.enable'>true</entry>
<entry key='forward.type'>mqtt</entry>
<entry key='event.forward.type'>mqtt</entry>
<entry key='event.forward.url'>mqtt://user:pass@IP:1883</entry>
<entry key='event.forward.topic'>traccar/events</entry>
Anton Tananaev2 years ago

We only support MQTT for events currently.

alexsahka2 years ago

I don't know about events only, here is the config for MQTT and locations there are the MQTT values with locations, see the pic attached.
The problem with MQTT compared to HTTP is not always updated and skips a lot of events and positions.

Here is the config for MQTT

Here is the MQTT value

Anton Tananaev2 years ago

Do you have an example of an event that was skipped?

alexsahka2 years ago

No, I do not have the example, but in general, I can see messages in HTTP but a very reduced quantity of messages in MQTT when GPS devices are moving.

Anton Tananaev2 years ago

Do you understand the difference between positions and events?

alexsahka2 years ago

Yes, I understand the difference. But why then did the MQTT message contain locations?

Anton Tananaev2 years ago

Because when forwarding events we also include positions where those events happened, but that's not all positions. That's absolutely expected that you won't receive all positions with events forwarding.

alexsahka2 years ago

I see, understand now. Thanks.