Dynamically fix service topic and subscription name
FunctionController.java
@FunctionName("notificationEventTopicTrigger") public void serviceBusTopicEvent( @ServiceBusTopicTrigger(name = "message", topicName = "%TOPIC_NAME%", subscriptionName = "%SUBS_NAME%", connection = "SERVICE_CONN_URL") String message, final ExecutionContext context) { logInfo("Service bus trigger processed a message..."); eventProcessor.processEvent(message); }
local.settings.json
{ "IsEncrypted": false, "Values": { "FUNCTIONS_WORKER_RUNTIME": "java", "AzureWebJobsStorage": "UseDevelopmentStorage=true", "SUBS_NAME": "notification1", "SERVICE_CONN_URL": "Endpoint=sb://test", "TOPIC_NAME": "notification-topic", }, "Host": { "LocalHttpPort": 7072, "CORS": "*", "CORSCredentials": false } }
application.yml
spring: cloud: azure: servicebus: connection-string: ${SERVICE_CONN_URL} namespace: poc123 topic-name: ${TOPIC_NAME} subscription-name: ${SUBS_NAME}