Event Streaming

Sienna Lloyd5 years ago

We currently use Traccar to centralize all of our varying GPS devices for a single source, and then we export the data from the database for upstream consumption. I want to rebuild the exporting process we have to use the Events functionality as an event stream, but I want to capture all events from the devices.

As part of that, I have some questions:

  • Is the Event documentation up to date?
  • If I wanted to create a custom event, is there an extension point or documentation on how to do that?
  • Traccar uses Notifications as a way to create an event stream, correct?

Thanks!

Anton Tananaev5 years ago

If I wanted to create a custom event, is there an extension point or documentation on how to do that?

There is no documentation, but you can just check how existing events are implemented in the code.

Traccar uses Notifications as a way to create an event stream, correct?

If you want to receive all events, you can use event forwarding functionality. It sounds like a perfect match for what you are trying to do.

Sienna Lloyd5 years ago

There is no documentation, but you can just check how existing events are implemented in the code.

Would we have to maintain a fork if we wanted a custom event, submit a PR, or is there support for loading in custom event handler libraries? I know in .NET I can add a DLL to the code base and the AppLoader will add it when the app starts, I'm assuming the Traccar framework can do the same thing?

If you want to receive all events, you can use event forwarding functionality

You're referring to Notifications, correct? I looked through the documentation on the web site and it's not inherently clear to me how event forwarding works, but I can revisit it.

receive all events

Is there an event for when a device reports it's location? The Events docs said it was current at the time of writing so I'm not sure how out of date it is or what lower-level options there are.

Anton Tananaev5 years ago

Would we have to maintain a fork

Depends on the event.

You're referring to Notifications, correct?

No, I'm referring to events forwarding.

Sienna Lloyd5 years ago

Ah okay, I read the config file and I understand now!

Last question! Does using Event Forwarding prevent the data from being stored in the database? Our current system scans the Traccar database at a regular interval and copies the data to another database. Would using Event Forwarding break that process?

Anton Tananaev5 years ago

No, it doesn't break or stop any other functionality.