davsclaus commented on code in PR #29618: URL: https://github.com/apache/camel/pull/29618#discussion_r4538077327
########## components/camel-kafka/src/main/java/org/apache/camel/component/kafka/PollExceptionStrategyFactory.java: ########## @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.kafka; + +import org.apache.kafka.clients.consumer.Consumer; + +/** + * Factory to create a {@link PollExceptionStrategy} for each Kafka consumer fetch thread. + * <p/> Review Comment: Kept as is on purpose: `<p/>` and `<tt>` are used throughout Camel, as said in the first review, and the bot agreed that no change is needed. Resolving. _Claude Code on behalf of davsclaus_ ########## components/camel-kafka/src/main/java/org/apache/camel/component/kafka/PollExceptionStrategyFactory.java: ########## @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.kafka; + +import org.apache.kafka.clients.consumer.Consumer; + +/** + * Factory to create a {@link PollExceptionStrategy} for each Kafka consumer fetch thread. + * <p/> + * Unlike setting a single {@link PollExceptionStrategy} on the component, which shares one instance across all consumer + * threads, this factory is invoked once per fetch thread and receives the owning fetch records task. This allows a + * custom strategy to be bound to its fetch records task, which is required by the built-in reconnect, stop, and bridge + * strategies to drive the consumer (for example to request a reconnect). It therefore also works correctly when a + * single endpoint uses multiple consumer threads (the <tt>consumersCount</tt> option). + */ Review Comment: Kept as is on purpose: `<p/>` and `<tt>` are used throughout Camel, as said in the first review, and the bot agreed that no change is needed. Resolving. _Claude Code on behalf of davsclaus_ ########## components/camel-kafka/src/main/java/org/apache/camel/component/kafka/consumer/errorhandler/DefaultPollExceptionStrategyFactory.java: ########## @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.kafka.consumer.errorhandler; + +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.component.kafka.KafkaEndpoint; +import org.apache.camel.component.kafka.KafkaFetchRecords; +import org.apache.camel.component.kafka.PollExceptionStrategy; +import org.apache.camel.component.kafka.PollExceptionStrategyFactory; +import org.apache.camel.component.kafka.PollOnError; +import org.apache.kafka.clients.consumer.Consumer; + +/** + * Default {@link PollExceptionStrategyFactory} that creates the built-in strategy selected by the endpoint's + * {@link PollOnError} configuration. + * <p/> Review Comment: Kept as is on purpose: `<p/>` and `<tt>` are used throughout Camel, as said in the first review, and the bot agreed that no change is needed. Resolving. _Claude Code on behalf of davsclaus_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
