Skip to content

Support custom message container hook #10050

@ansd

Description

@ansd

Is your feature request related to a problem? Please describe.

It may be desirable to store arbitrary annotations when receiving from a source protocol such that these annotations will be available when consuming.

Describe the solution you'd like

AMQP 0.9.1 channel, MQTT connection, AMQP session, STOMP connection should provide a hook where the message container and the channel state / MQTT processor state / AMQP session state / STOMP processor state are passed in. Then 3rd party implementations can set whatever annotations they want and they will be picked up automatically when consuming from a different protocol:

  • when consuming via AMQP 0.9.1, these annotations will be set as headers
  • when consuming via AMQP, these x-* annotations will be set as message annotations
  • when consuming via MQTT, these annotations could be set as User Property

Describe alternatives you've considered

Somewhat related to #10051

Additional context

This allows for use cases such as https://groups.google.com/g/rabbitmq-users/c/gPJxxG2PGXM/m/EF2BDwpIAQAJ
For MQTT this pluggable message container approach gets called at the same place as

Msg = rabbit_message_interceptor:intercept(Msg0),
, i.e. where we currently call rabbit_message_interceptor. This hook gets as input the message container and the MQTT processor state. The 3rd party implementation could add here the MQTT client ID as annotation. Therefore the MQTT client ID will be available when receiving via AMQP 0.9.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions