Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kafka Sink rewrite without fs2-kafka (#100)
Previously we were using the fs2-kafka wrapper around the KafkaProducer when sending events to Kafka. The fs2-kafka wrapper executes every `send` on the CE3 blocking thread. We found in the Snowplow collector that this implementation can be problematic because under some blocking scenarios it causes the CE3 blocking thread pool to create a very large number of threads. The huge number of threads could cause a OOM. This new implementation still uses the CE3 blocking thread pool, but it calls `send` many times within the same `Sync[F].blocking{...}`. This should prevent the problem where very many concurruent calls to `Sync[F].blocking` triggers the thread pool to grow to one thread per pending event. Note, this implementation is different to what we chose for the Snowplow collector. For the latter, we used a dedicated single-thread executor for calling `send`. The difference is because in common-streams we have the luxury of working in batches, whereas the Snowplow collector tends to receive events one-by-one, and thus needs to call `send` one-by-one.
- Loading branch information