Returning ServiceBusMessage doesn't work correctly
See original GitHub issueWhen returning a ServiceBusMessage
, the message posted contains incorrect information.
[Function(nameof(Run))]
[ServiceBusOutput("audit", Connection = "AzureServiceBus")]
public async Task<ServiceBusMessage> Run([ServiceBusTrigger("Notifications", Connection = "AzureServiceBus")] ServiceBusReceivedMessage message)
{
// removed for brevity
return new ServiceBusMessage(rawMessage);
}
For an incoming message
The returned message body is
1 - missing original header 2 - incorrect body 3 - incorrect content type
Expected:
1 - the original header (EventType
) is found
2 - original body
3 - correct content type
Issue Analytics
- State:
- Created a month ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
In Azure function that returns ServiceBus message, how do ...
I have an azure function which returns a service bus message. However, I want to conditionally return a service bus message, ...
Read more >Troubleshooting guide for Azure Service Bus
This article provides troubleshooting tips and recommendations for a few issues that you may see when using Azure Service Bus.
Read more >Azure Service Bus message transfers, locks, and settlement
This article provides an overview of Azure Service Bus message transfers, locks, and settlement operations.
Read more >Azure Functions Isolated Worker - Sending multiple messages
Hello, I am having a really hard time getting this to work, and I see this error about being 'unable to configure binding',...
Read more >azure.servicebus package — Azure SDK for Python 2.0.0 ...
Setting this value enables assigning related messages to the same internal partition, so that submission sequence order is correctly recorded. The partition is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 on that.
Also, I’d suggest showing the sample how to handle the incoming message from middleware. Much of the boilerplate code could be moved from functions into middleware (related to issue #1824) when implementing some sort of custom framework on top of SB-triggered functions.
This might be more effective as the clients could be cached based on the connection and entity those are requested for.
With all that said, receiving a
ServiceBusReceivedMessage
and returning from function aServiceBusMessage
would be extremely simple and powerful. And would satisfy a lot of scenarios where an incoming message is generating an outgoing message. For multiple messages, I’d agree that a client is a better approach (IAsyncCollector
in In-Proc SDK was a bit of a weird API). But for a single returned message, there’s a value in considering returning just aServiceBusMessage
w/o the need for a client or sender.