Hello all,
With the pending closure of the NRDP PushPort feed, I have been working on updating our interface that accepts data from PushPort to use Kafka instead of ActiveMQ. Here are some notes that may be of use to others.
First some notes on Kafka:
Kafka topics are split into partitions. Each partition acts as a queue, but Kafka clients switch between the partitions in a manner that does not allow delivery order to be guaranteed.
The RDM Kafka topic has two partitions.
In theory, this limits us to a single client as you normally want to have at least two partitions per client to avoid a client being idle.
In practice, there is so much data coming in on both partitions that this will not be the case.
You will still want to just have a single client if you want to sort out message ordering (see below).
There is a known issue where events for a single train can be found in both partitions. This has been reported on:
As a result of this issue, I have been looking at implementing a buffer that uses the PushPort sequence number to enforce the correct ordering of events and detect any missing messages.
Observations based on testing the RDM PushPort Kafka feed:
The Kafka feed offers a much longer history of events when compared to the ActiveMQ feed
You can access this history on startup/restart by setting the auto.offset.reset property to earliest
This will start retrieving events from between 60 and 150 minutes in the past (as opposed to 5 minutes - IIRC - for the ActiveMQ feed)
The flush time for the Kafka feed appears to vary between partitions.
In my last test, I had a 150 minute history on partition 1 but only a 120 minute history on partition 0
This guarantees that you will have missing events until you have processed the first 30 minutes of partition 1's data.
Sometimes the messages come in out of sequence even within a partition. Here is an example from when my client was catching up:
Even when not processing the history, there can be some latency.
Usually this is sub-second, with occasional spikes up to 5 seconds.
I have seen the latency get as high as 58 seconds.
I think that the higher the latency, the more likely you are to get messages out of sequence in the same partition.
Hopefully these observations will be of interest/use.
Cheers,
Chris