-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers? #197
Comments
ghost
added
the
Needs: Triage (Functions)
label
Jun 13, 2022
Can you try this? Bind the RabbitMQTrigger to |
That works great!
Is there an equivalent for sending? We have been using (for ServiceBus)
IAsyncCollector<ServiceBusMessage> ?
…On Tue, Jun 14, 2022 at 8:44 AM Jatin Sanghvi ***@***.***> wrote:
Can you try this? Bind the RabbitMQTrigger to BasicDeliverEventArgs type
as in here
<https://github.com/Azure/azure-functions-rabbitmq-extension/blob/e100c191fc442abe02b611643d032789714763d3/extension/WebJobs.Extensions.RabbitMQ.Samples/RabbitMQSamples.cs#L96-L98>.
Then look for headers under args.BasicProperties.Headers.
—
Reply to this email directly, view it on GitHub
<#197 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANDFMZF5GXVQJGU5I2C6DVPAZ4RANCNFSM5YU3VLEQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Hi, I had a suggestion but did not get time try it out myself earlier. Here is what is possible: public static void BindToChannel(
[TimerTrigger("01:00", RunOnStartup = true)] TimerInfo timer,
[RabbitMQ(ConnectionStringSetting = "rabbitMQ")] IModel channel)
{
channel.QueueDeclare(queue: "hello", false, false, false, null);
IBasicProperties properties = channel.CreateBasicProperties();
properties.Headers = new Dictionary<string, object> { ["headerName"] = "headerValue" };
byte[] body = Encoding.UTF8.GetBytes("Hello World!");
channel.BasicPublish(exchange: string.Empty, routingKey: "hello", properties, body);
} |
ghost
removed
the
Needs: Triage (Functions)
label
Jun 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With Azure, I can use IAsyncCollector and ServiceBusReceivedMessage[] in my functions in order to get access to the message headers.
This is important to extract metadata.
How is this achieved with the RabbitMQ binding?
The text was updated successfully, but these errors were encountered: