In my previous video , we have explained the steps to create queue storage in azure portal . If you not created please follow the steps here-https://kbtutorials.in/2024/03/30/steps-to-create-azure-storage-account/
Here are the steps :
1)Please create a spring boot application if not presented –https://start.spring.io/
2)Add below dependencies –
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>5.10.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.azure/azure-storage-queue -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.20.2</version>
</dependency>
3) We are going to use QueueClient object to connect azure storage queue with spring boot. like below .
@Bean
public QueueClient getQueueClient(){
QueueClient client = new QueueClientBuilder()
.endpoint("Queue End point")
.queueName("Queue Name")
.sasToken("sas token")
.buildClient();
client.createIfNotExists();
return client;
}
Here we need to identify few fields like
- EndPoint – Go to Storage account overview- click on View in Json Mode.
In Json will be opened in new tab. There you can see the
2) Queue Name is the storage Queue you have created.
3)To Get SAS End point – Click on Shared Access Signature.
- Select allowed resource types as Service ,Container and Object provide end date then click on generate sas token . Then copy that sas token url use it in QueueClient object.
Please use below tutorial for more details-
- Java Streams anyMatch vs Streams noneMatch
- Streams Summary Statistics in Java
- 5 Different Ways To Sum All Elements in Array Java
- Print Only Odd Numbers in Array Using Streams in Java
- Print Only Even Numbers in Array Using Streams in Java
- Java Streams anyMatch vs Streams noneMatch
- Streams Summary Statistics in Java
- 5 Different Ways To Sum All Elements in Array Java
- Print Only Odd Numbers in Array Using Streams in Java
- Print Only Even Numbers in Array Using Streams in Java
Leave a Reply