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

Camel Kafka Component: batch producer with individual headers

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.18.2
    • 3.18.3, 3.19.0
    • camel-kafka
    • None
    • Unknown

    Description

      Hi all, if we look at classes KafkaProducer and KeyValueIterator, we see that it is possible to send a batch of kafka messages, but only with identical set of headers which is determined by the „parent“ Exchange which holds the Iterator or Iterable in its body.

      In our usecase, the body contains a list of Exchanges which we want to use to determine the individual headers for every batch-instance in the same way like currently the „parent“ Exchange is used. Actually we solve our demands by creating some copy/pasting the mentioned classes and applying minor changes to it (which is a dirty hack).

      Our proposal is to define a new configuration flag named like „batchWithIndividualHeaders“ which enables the creation of individual headers.

      To implement this, the constructor parameter „propagatedHeaders“ in class KeyValueHolderIterator might by replaced with some kind of Provider-Lambda which relays to KafkaProducer::getPropagatedHeaders, but is called inside KeyValueHolderIterator for every batch-element.

      IMHO this is a common usecase and worth to implement it in the camel library itself.

       

      see also entry in dev-maillist

      Attachments

        Activity

          People

            Unassigned Unassigned
            Wiedmann87 Ralf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: