Release 5.6 - MQTT support for event forwarding

francis32 years ago

I've just upgraded to the latest release.

I'm interested in the new MQTT support for event forwarding, searched the forum
and found some reference here:

So I added the following lines (modified accordingly to my mqtt server) in my traccar.xml config file

<entry key='event.forward.type'>mqtt</entry>
<entry key='event.forward.url'>mqtt://user:pass@mqtt.example.com:1883</entry>
<entry key='event.forward.topic'>traccar/events</entry>

But when I restart the server it throws the following error in the logs:

2023-02-07 11:10:48  WARN: Failed to initialize a channel. Closing: [id: 0x75b46f0b] - sun.misc.Unsafe - ClassNotFoundException (... < EventForwarderMqtt:74 < MainModule:334 < <gener:-1 < ...)
2023-02-07 11:10:48 ERROR: Main method error - StacklessClosedChannelException (...)

And hangs.
Any suggestion?

Regards,
francis3

Anton Tananaev2 years ago

Are you sure you're using an official release?

francis32 years ago

Sure. Downloaded from the latest release page.

Regards,
francis3

Anton Tananaev2 years ago

Looks like there's some issue with dependencies.

Merle19982 years ago

Hi,
if I understand correctly, the jdk.unsupported has been integrated on Github, but not yet in the 5.6 release, right?
Can this module be installed afterwards in order to be able to use Mqtt forwarding?
What would be the best course of action, or better to wait for a new release?

Anton Tananaev2 years ago

You can download a version from here:

https://www.traccar.org/preview/

Merle19982 years ago

Thanks for the link. After installation (preview version) traccar works as expected,
until the entries for mqtt in traccar.xml were added.
In the log it looked to me as if the event was not additionally forwarded, but instead.
There were also no more updates on the web interface.
On my system I could see that a connection was established and terminated:
(traccar-37504a8a-.....] connected with secret... traccar-37504a8a-.....] connection closed: closed)
but no data was coming in. I didn't investigate this further because a working Traccar is more important to me as mqtt forwarding.
After removing the mqtt entries and restarting Traccar works.

Anton Tananaev2 years ago

Can you please comment on the pull request.

francis32 years ago

Just upgraded traccar server to the latest release (5.7)

Need to do more testing.
But now traccar server starts without any issue,
and mqtt messages arrive at the mqtt server.

Regards,
francis3

Christopha year ago

hello. any news for the MQTT event forward. i have the latest traccar version. if you make the forward entry in traccar.xml there is the error:

WARN: Failed to initialize a channel. Closing: [id: 0xca0733ea] - Server host must not be null. - NullPointerException (... < EventForwarderMqtt:64 < MainModule:366 < <gener:-1 < ...)
2023-07-13 10:04:32 ERROR: Main method error - StacklessClosedChannelException (...)

I would need it to feed NodeRED

Christoph

Anton Tananaeva year ago

It seems like you haven't configure it correctly.

Christopha year ago

i have add in the traccar.xml:

<entry key='event.forward.type'>mqtt</entry>
<entry key='event.forward.url'>mqtt://user:pass@mqtt-carehub.caresms.ch:1883</entry>
<entry key='event.forward.topic'>traccar/events</entry>

the server is my MQTT broker

Christopha year ago

question for my understanding. I assume that traccar has the role of an MQTT client. is that correct?

Anton Tananaeva year ago

I guess MQTT doesn't like your URL for some reason. Maybe you have special characters in the password that break it?

Christopha year ago

step by step..... ;) now it is run i have a connect to my MQTT broker