[ 
https://issues.apache.org/jira/browse/CAMEL-21774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929161#comment-17929161
 ] 

Claus Ibsen commented on CAMEL-21774:
-------------------------------------

Okay we also can do bridgeErrorHandler=true and handle the exception in a camel 
route
{code:java}
2025-02-21 14:10:58.771  INFO 45355 --- [onsumer[foobar]] 
port.subcription.DefaultSubscribeAdapter : Subscribing to topic(s) foobar
2025-02-21 14:10:58.772  INFO 45355 --- [onsumer[foobar]] 
s.consumer.internals.LegacyKafkaConsumer : [Consumer 
clientId=consumer-b3297f26-76ac-42f2-88fc-14112369c28d-1, 
groupId=b3297f26-76ac-42f2-88fc-14112369c28d] Subscribed to topic(s): foobar
2025-02-21 14:10:58.777  WARN 45355 --- [onsumer[foobar]] 
org.apache.kafka.clients.NetworkClient   : [Consumer 
clientId=consumer-b3297f26-76ac-42f2-88fc-14112369c28d-1, 
groupId=b3297f26-76ac-42f2-88fc-14112369c28d] Error while fetching metadata 
with correlation id 10 : {foobar=UNKNOWN_TOPIC_OR_PARTITION}
2025-02-21 14:10:58.780  WARN 45355 --- [onsumer[foobar]] 
.camel.component.kafka.KafkaFetchRecords : Error subscribing 
org.apache.kafka.clients.consumer.KafkaConsumer due to: Topic foobar does not 
exists
org.apache.kafka.common.errors.UnknownTopicOrPartitionException: Topic foobar 
does not exists
2025-02-21 14:10:58.781  WARN 45355 --- [onsumer[foobar]] 
consumer.camel.yaml:28                   : Darn something did not work Topic 
foobar does not exists {code}

> camel-kafka - Add topicMustExists option so consumer can fail if broker has 
> no topic
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-21774
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21774
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-kafka
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.11.0
>
>
> You may connect to a kafka broker with a given topic name, and the broker is 
> configured to not auto-create. And the consumer will then fail to subscribe, 
> and keep looping.
> We should have option topicMustExist=true|false you can set so you can tell 
> Camel to fail if the topic does not exist.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to