Skip to content

Ability to pass options/headers when using InvokeAsync #1151

Open
@MichalTichy

Description

@MichalTichy

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

I am trying to pass metadata (e.g., userId, etc.) alongside messages in message headers. When using SendAsync or PublishAsync, I can easily pass options as method param. However, InvokeAsync does not allow this.

I've tried passing options using the WithDeliveryOptions method. The problem is that routing then does not find handlers that do not request a wrapped message (DeliveryMessage<T>).

Describe the solution you'd like
It would be helpful if InvokeAsync could accept options in the same way that SendAsync does.
Or is there any other approach that would solve my problem?

Describe alternatives you've considered

Currently, I pass the user ID using a field intended for tenancy.

Additional context

The metadata I need is processed by middleware and is not required in the handlers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions