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

Support custom Kafka client instances

    XMLWordPrintableJSON

    Details

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

      Description

      The camel-kafka component instantiates Kafka client instances (e.g., KafkaConsumer and KafkaProducer) directly. This prevents users to leverage their own custom implementations for them. Kafka Streams library solved this issue a long time ago (see https://issues.apache.org/jira/browse/KAFKA-3616) adding the ability to pass a factory of Kafka clients to the Streams processor.

      Steps for implementation:

      1. Add a new `KafkaClientFactory` interface with methods to get instances of Kafka's `KafkaConsumer` and `KafkaProducer`.
      2. Add a default implementation `DefaultKafkaClientFactory` that instantiates both as they are at the moment inside the Camel's `KafkaConsumer` and `KafkaProducer` (simply calling `new` with a `Properties` object).
      3. Add a new 'KafkaClientFactory' configuration option that defaults to `DefaultKafkaClientFactory`.
      4. Use this factory inside Camel's `KafkaConsumer` and `KafkaProducer` (instead of doing a `new` directly).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              javierholguera Javier Holguera
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: