Skip to content

MTChannelBroker: Enhance failed events with extra metadata #6541

Closed

Description

@matzew

If a message is routed to the deadletter sink of the MTChannelBroker or its Triggers, there is no contextual information on why the message landed there.

In a few Knative components, we have some metadata for this:

Would be nice if the reference implementation of the MTChannelBroker would have this feature too

Activity

  1. added
    kind/good-first-issue
    good first issue
    on Sep 27, 2022
  2. liuchangyan commented on Sep 27, 2022

    @liuchangyan
    Contributor

    /assign

  3. lionelvillard commented on Sep 27, 2022

    @lionelvillard
    Contributor

    We may want to go further by standardizing these attributes and adding them to the knative spec.

    @gab-satchi @gabo1208 WDYT?

  4. liuchangyan commented on Oct 14, 2022

    @liuchangyan
    Contributor

    Hi, I am working on adding "knativeerrordest knativeerrorcode knativeerrordata" extensions on MTchannelBroker,
    Most of the data in MTchannelBroker is processed by Channels:
    In Control-Plane of MTchannelBroker, mt-broker-controller create subscription according to the information of the trigger, this subscription contains the address of subscriber(broker-filter) and the information of Broker, like this example:

    apiVersion: messaging.knative.dev/v1
    kind: Subscription
    metadata:
      name: default-trigger1-3f6e7a8e-f7d1-4c8f-a25a-1970b6ab73e3
      namespace: default
    spec:
      channel:
        apiVersion: messaging.knative.dev/v1beta1
        kind: NatssChannel
        name: default-kne-trigger
      reply:
        ref:
          apiVersion: eventing.knative.dev/v1
          kind: Broker
          name: default
          namespace: default
      subscriber:
        uri: http://broker-filter.knative-eventing.svc.cluster.local/triggers/default/trigger1/3f6e7a8e-f7d1-4c8f-a25a-1970b6ab73e3
    

    So in the entire data flow, the path of event message is channel->broker-filter->target; and the path pf response is target->broker-filter->channel, and the extention "knativeerrordest" what we got is broker-filter's URI, but what we need is actual trigger's URI.

    Based on this situation, there are two methods that we could get trigger's URI:

    Method 1: In broker-filter, we could add a pair of key value in response body to store trigger's URI. After getting response Channel could unmarshal this URI when the destination is broker-filter.

    Method 2: We could add processing logic about deadlettersink in broker-filter when sending error is not nil , do the same like Channel.

    Which one is better? is there any other methods and what do you think? @pierDipi @matzew

  5. added a commit that references this issue on Nov 16, 2022
    ed5e0a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuekind/feature-requestkind/good-first-issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions