This sample project demonstrates how to use Service Bus via Spring Boot Starter azure-servicebus-spring-boot-starter.
-
An Azure subscription; if you don't already have an Azure subscription, you can activate your MSDN subscriber benefits or sign up for a free Azure account.
-
A Java Development Kit (JDK), version 1.8.
-
Apache Maven, version 3.0 or later.
- Go to Azure portal and create the service by following this link.
- Mark down the
Primary Connection String. - In the
Overviewblade, create queue and topic. Mark down your queue name and topic name. - Click your created topic, add subscription in the
Subscriptionsblade. Mark down your subscription name.
- Navigate to
src/main/resourcesand openapplication.properties. - Fill in the
connection-string,queue-name,topic-nameandsubscription-name.
-
Change directory to folder
azure-servicebus-spring-boot-sample. -
Run below commands.
-
Use Maven
mvn package java -jar target/azure-servicebus-spring-boot-sample-0.0.1-SNAPSHOT.jar -
Use Gradle
gradle bootRepackage java -jar build/libs/azure-servicebus-spring-boot-sample-0.0.1-SNAPSHOT.jar
-
Please check the following table for reference links of detailed Service Bus usage.