2

I am trying to get SessionId, DeliveryCount from an Azure Service Bus Queue trigger in a Java Azure function. I am able to do this easily in a C# Function App. Somehow I found a way to get the Application Properties using binding. But unfortunately am unable to get the above mentioned properties. Any help is appreciated.

@FunctionName("ServiceBusQueueTriggerJava")
    public void run(
            @ServiceBusQueueTrigger(name = "message", queueName = "%ServiceBusQueue%", connection = "ServiceBusConnString", isSessionsEnabled = true) String message,
            final ExecutionContext context, @BindingName("ApplicationProperties") Map<String, Object> properties) {
        Logger log = context.getLogger();
        log.info("Java Service Bus Queue trigger function executed.");
        properties.entrySet().forEach(entry -> {
            log.info(entry.getKey() + " : " + entry.getValue());
        });
        log.info(message);
    }
Jeevan
  • 43
  • 5
  • Trigger Details when running the function app shows SessionId and DeliveryCount. But am unable to fetch it from java code. :( – Jeevan Nov 17 '21 at 23:52

0 Answers0