spring-attic / spring-integration-kafka

Apache License 2.0
324 stars 180 forks source link

I notice that offsets are going up in increments of two #306

Closed StruggleAlex closed 4 years ago

StruggleAlex commented 4 years ago

I notice that offsets are going up in increments of two, and understand that the odd-numbered messages are part of the 2-phase commit of Kafka transactions.it is not fetching these odd-numbered messages. Is there anything I can do to get them?

garyrussell commented 4 years ago

Github issues are not for asking questions; they are for reporting bugs and asking for new features.

There is no "2-phase commit" with Kafka transactions. These extra records are not real records, they are markers to indicate whether the previous transaction was successful or not. There is nothing to "get" that is meaningful outside of the broker.

If you publish 10 records in a transaction, it will use 11 slots in the log; if you only publish 1 record, it will use 2 slots.

garyrussell commented 4 years ago

If you have further questions; ask on Stack Overflow.

StruggleAlex commented 4 years ago

I see. Thanks anyway