Unable to Intercept Envelope Headers Before RabbitMQ Transport Execution in Wolverine with InvokeAsync Operation #1873
Unanswered
adarshanadig
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
I’m trying to capture envelope message details such as CorrelationId and also add additional information to the header (like user credentials and other metadata). However, I’m unable to achieve this. I’ve tried using middleware, IEnvelopeRule, and IRabbitMqEnvelopeMapper, but none of these seem to be triggered once InvokeAsync is called, before the execution reaches the RabbitMQ transport layer.
am using latest version 5.4.0 . Any suggestion please
Below are client side configuration tried
builder.UseWolverine(static opts =>
{
opts.Discovery
// Turn off the default handler conventions altogether
.DisableConventionalDiscovery();
});
and Middleware and IEnvlopeRule and IRabbitMqEnvelopeMapper implementionation are below
public class EnvelopeInterceptRule : IEnvelopeRule
{
}
public class EnvelopHanlingMiddleware
{
public async Task BeforeAsync(
Envelope envelope,
Func next)
{
Console.WriteLine("Entered into middleware");
await next();
}
}
public class CustomRabbitMqMapper : IRabbitMqEnvelopeMapper
{
public void MapEnvelopeToOutgoing(Envelope envelope, IBasicProperties props)
{
Console.WriteLine("MAPPER CALLED (outgoing)");
}
Beta Was this translation helpful? Give feedback.
All reactions