Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

KafkaMessageSource and concurrency #211

@bruto0

Description

@bruto0

If you disable autoack in AcknowledgmentCallbackFactory and ack/requeue offsets in a different thread from the one poller is operating on, all sorts of things become possible here under sufficient load:

			Set<KafkaAckInfo<K, V>> candidates = this.ackInfo.getOffsets().get(this.ackInfo.getTopicPartition());
			KafkaAckInfo<K, V> ackInfo = null;
				if (candidates.iterator().next().equals(this.ackInfo)) {
				// see if there are any pending acks for higher offsets
				List<KafkaAckInfo<K, V>> toCommit = new ArrayList<>();
				for (KafkaAckInfo<K, V> info : candidates) {

ConcurrentModificationException, NoSuchElementException

Also, acknowledged flag is set in the finally block of KafkaAckCallback.acknowledge unconditionally, although in case of ConcurrentModificationException you likely want to try ack'ing the offset again

And while we're at it, it'd be nice to have an ability to ack a bunch of offsets belonging to the same partition without sync'ing on the consumerMonitor for each one, but you'd have to expose KafkaMessageSource from the inbound channel adapter for that to work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions