Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12076

Camel Kafka producer: Specified topic is ignored ("No topic key set" error) when KafkaConfiguration is used

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.20.1
    • Fix Version/s: 2.21.0
    • Component/s: camel-kafka
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Specified topic is ignored ("No topic key set" error) when KafkaConfiguration is used. When topic is set inside KafkaConfiguration then no error occurs.

      <spring-boot.version>1.5.8.RELEASE</spring-boot.version>
      <camel.version>2.20.1</camel.version>

              from("direct:sendToKafka")
                      .setBody(constant("Message from Camel to Kafka"))
                      .setHeader(KafkaConstants.KEY, constant("Camel"))
                      .to("kafka:TESTTOPIC?configuration=#kafkaConfiguration");
      
      2017-12-11 14:16:35.466 ERROR 12048 --- [ad #1 - WireTap] CamelRouter                              : Exchange[ExchangePattern: InOnly, BodyType: String, Body: Message from Camel to Kafka, CaughtExceptionType: org.apache.camel.CamelExchangeException, CaughtExcept
      ionMessage: No topic key set. Exchange[ID-5CG7383K6H00BA-1512994577303-0-3], StackTrace: org.apache.camel.CamelExchangeException: No topic key set. Exchange[ID-5CG7383K6H00BA-1512994577303-0-3]
              at org.apache.camel.component.kafka.KafkaProducer.createRecorder(KafkaProducer.java:149)
              at org.apache.camel.component.kafka.KafkaProducer.process(KafkaProducer.java:251)
              at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
              at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
              at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
              at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
              at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
              at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:132)
              at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445)
              at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:127)
              at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
              at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
              at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:158)
              at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:153)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      ]
      

        Attachments

          Activity

            People

            • Assignee:
              dmvolod Dmitry Volodin
              Reporter:
              pointless2006 Igor Lavrentjev
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: