embeddedkafka / embedded-kafka

A library that provides an in-memory Kafka instance to run your tests against.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for kafka transactions?

patricenys opened this issue · comments

Hi,
I'm using Alpakka Transactions (https://doc.akka.io/docs/alpakka-kafka/current/transactions.html) to consume from one topic and produce to another one. When I try to test this with the embedded-kafka it seems it is never producing to the target topic and/or committing the consumer offset. Using the adminclient I cannot find back the group-id of the consumer. When I run exactly the same code with a local kafka instance (so not the embedded kafka) it works fine.
Does embedded-kafka support transactions?
Patrice

Hi @patricenys,
transactionality is a property of Consumers or Producers, it doesn't affect broker configuration, so you can use embedded-kafka normally, as you would with a real Kafka cluster.

Are you using your Consumers/Producers along with embedded-kafka for testing purposes?

Indeed, we are using it for testing purposes. We basically have a flow like described on the alpakka documentation, connecting a consumer to a producer.

Then AFAIK you don't have to configure anything on the broker itself..

Do you have any piece of code that you can share which is not working as expected?

Unfortunately I cannot share anything directly but it's very similar to how it's described on the alpakka transactions page (https://doc.akka.io/docs/alpakka-kafka/current/transactions.html). My best guess there is somewhere an incompatibility between this and the embedded-kafka. Anyways I have found an alternative for now. Thanks for your answer.

Closing this, though I'm open to further discussion on the topic.