Update an existing microservice to use the queues
You have now reviewed how an existing microservice interacts with the Service Bus queue. In the upcoming task, you will enable the visits
microservice to also read messages from a queue and write messages to another queue. You can use the following guidance to implement these changes:
- Use Java Message Service 2.0 API with Azure Service Bus Premium.
- How to use the Spring Boot Starter for Azure Service Bus JMS.
To start, you will need to add the necessary dependencies.
Step by step guidance
-
From the Git Bash window, in the src directory of the java-microservices-aks-lab repository you cloned locally, use your favorite text editor to open the
spring-petclinic-microservices/spring-petclinic-visits-service/pom.xml
file of thevisits
microservice. In the<!-- Spring Cloud -->
section, following the last dependency element, add the following dependency element:<dependency> <groupId>com.azure.spring</groupId> <artifactId>spring-cloud-azure-starter-servicebus-jms</artifactId> </dependency>