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

knative producer with ProducerTemplate is missing the fromRouteId

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 3.18.1
    • 3.18.3, 3.19.0
    • camel-knative
    • None
    • Unknown

    Description

      Knative camel producer creates CloudEvents. To have a valid CloudEvent, there's the need to have a field named `source`.

      The knative camel producer sets this value by putting the "fromRouteId" value. This value is set by DefaultConsumer when creating the extended exchange.

      However, when using the knative producer via ProducerTemplate, we miss this value. And the event is rejected because source is required by knative.

      Log :

      {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed to validate extracted event","error":"source: REQUIRED\n"} 

      As a temporary fix, we could ask user to override the source value, as in this configuration example :

      {
        "type": "event",
        "name": "YOUR_NAME_EVENT",
        "url": "YOUR_LINK_TO_BROKER",
        "metadata": {
          "camel.endpoint.kind": "sink"
        },
        "ceOverrides": {
          "ce-source": "YOUR_SOURCE_NAME"
        }
      } 

      However, it doesn't seem right to suppose in the code this value is coming necessarly from a Camel Consumer.

      Attachments

        Activity

          People

            zbendhiba Zineb Bendhiba
            zbendhiba Zineb Bendhiba
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: