Search code examples
javaazure-functionsazureservicebus

Azure Functions Service Bus output binding - message properties


@FunctionName("MyFunction")
public void run(
        @ServiceBusQueueTrigger(name = "message", queueName = "Input", connection = "connStr") String message,
        @BindingName("UserProperties") Map<String, Object> properties,
        @ServiceBusQueueOutput(name = "result", queueName = "Output", connection = "connStr") OutputBinding<String> result,
        ExecutionContext context
) {
    // do something
    result.setValue("output msg");
}

In the input binding I can easily fetch the message properties using the @BindingName("UserProperties") annotation, like in the code above. Is there a similar way to customize the properties of the output binding message?

I could use the Service Bus SDK to send the message with custom properties at the end of my function, but I'd really prefer to do it the binding way.


Solution

  • Unfortunately, this isn't supported for non-C# languages. You will have to instead use the Azure Service Bus SDK directly.