This sample project demonstrates how to use Service Bus with Spring Boot.
-
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-name, andsubscription-name.
-
Change directory to folder
azure-spring-boot-sample-servicebus. -
Run below commands.
mvn package java -jar target/azure-spring-boot-sample-servicebus-0.0.1-SNAPSHOT.jar
Please check the following table for reference links of detailed Service Bus usage.
| Type | Reference Link |
|---|---|
Queues |
Use Azure Service Bus queues with Java to send and receive messages |
Topics & Subscriptions |
Use Service Bus topics and subscriptions with Java |