Azure / azure-functions-java-library

Contains annotations for writing Azure Functions in Java
MIT License
43 stars 43 forks source link

Access to Service Bus message application properties for trigger and output #212

Open emilwihlander opened 4 months ago

emilwihlander commented 4 months ago

When using the spring-cloud-azure-starter-servicebus library for regular Spring Boot applications you can use the wrapper class ServiceBusMessage to get and set the application properties (message.getApplicationProperties().put("key", "value"), for example).

But when I setup an Azure Function I have found no way to either get application properties from incoming message, nor being able to set it for outgoing messages.

@Component
public class UppercaseFunction {

    @FunctionName("uppercase")
    public void run(
             @ServiceBusQueueTrigger(/* config */) String message,
            @ServiceBusQueueOutput(/* config */) OutputBinding<String> output) {
        // How would I read application properties from the incoming message?
        output.setValue(message.toUpperCase());
        // How would I set application properties on the outgoing message?
    }
}

Have I missed some part of the documentation or is this not supported?