I saw the Microsoft documentation for Azure Service Bus output binding for Azure Functions version 3. When I want to send a message to a service bus as return of the function, I can use this code:
[FunctionName("ServiceBusOutput")]
[return: ServiceBus("myqueue", Connection = "ServiceBusConnection")]
public static string ServiceBusOutput([HttpTrigger] dynamic input, ILogger log)
{
log.LogInformation($"C# function processed: {input.Text}");
return input.Text;
}
My problem started when I want to have as an output 2 messages to different Service Bus. Is it possible to output binding more than one output? In the online editor you can add more than one output. How can I do that in the code?
In the documentation there is a section of Usage, it explains what I can use as output binding. They mention ICollector<T>
or IAsyncCollector<T>
but I'm not sure it is what I'm looking for.
Other question is what happens in an API that returns one value to the bus and another to the user?