shashank created CAMEL-26709:
--------------------------------
Summary: camel-kafka - SingleNodeKafkaResumeStrategy does not work
after a route restart, and one bad record stops loading offsets
Key: CAMEL-26709
URL: https://issues.apache.org/jira/browse/CAMEL-26709
Project: Camel
Issue Type: Bug
Components: camel-kafka
Reporter: shashank
Assignee: shashank
A route stop/start (JMX, the route controller, a route policy) stops the resume
strategy of the route and starts it again ({{ResumableProcessor}}, and
{{Splitter}} with a resume strategy). {{SingleNodeKafkaResumeStrategy}} does
not support this:
* {{stop()}} closes the producer but keeps it, and {{start()}} only creates a
producer when there is none. Every later {{updateLastOffset}} fails with
"Cannot perform operation after producer has been closed" (only logged by the
resumable completion, so the route keeps running and the offsets are lost;
after the next application restart the records are processed again).
* {{stop()}} shuts down the executor but keeps it, and {{loadCache()}} submits
the refresh task to it again, so the offsets are not loaded any more.
* {{subscribed}} stays true, so the consumer of the next start does not
subscribe to the topic.
Also, one record of the resume topic that cannot be deserialized, for example
one without a key or value (a tombstone on a compacted topic), makes {{poll()}}
throw ({{ByteBuffer.wrap(null)}}). {{refresh()}} logs it once and the refresh
thread ends, so every later offset is no longer loaded.
CAMEL-23996 fixed the unlock in {{stop()}}, but not the restart.
Expected: after a stop/start the strategy uses a new producer, executor and
subscribed consumer, and a record that cannot be deserialized is skipped with a
WARN.
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)