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

Topic is not set if a KafkaConfiguration is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.7.3, 3.10.0
    • 3.11.0
    • camel-kafka
    • None
    • Unknown

    Description

      If a KafkaConfiguration is used (see code) and no topic is defined in the configuration, the parameter from the URI is not taken over, but a null value is set.
      This leads to a consumer not having a valid topic name, but null being provided as a value.

      It looks like setProperties(endpoint, parameters); overrites the topic.

      KafkaConfiguration

      @Bean
      public KafkaConfiguration kafkaConfig() {
           KafkaConfiguration kafkaConfiguration = new KafkaConfiguration();
           kafkaConfiguration.setBrokers(..);
           kafkaConfiguration.setClientId(..);
           //kafkaConfiguration.setTopic(kafkaTopic);
      return kafkaConfiguration ;
      

      Route

      from(kafka({{topic.name}}?configuration=#kafkaConfig"))
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              FloEc Florian Eckhard
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: