Skip to content

Commit

Permalink
format README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
backwind1233 committed Dec 14, 2021
1 parent f938b28 commit 7ee7b77
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ This code sample demonstrates how to use Spring Integration for Azure Service Bu

## What You Will build


You will build an application that using Spring Integration for Azure Service Bus to send and receive messages from one queue in one Service Bus namespace and then forward them to another queue in another Service Bus namespace.

## What You Need

- [An Azure subscription](https://azure.microsoft.com/en-us/free/)
- [Terraform](https://www.terraform.io/)
- [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=mac)
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
- JDK8
- Maven
* [An Azure subscription](https://azure.microsoft.com/en-us/free/)
* [Terraform](https://www.terraform.io/)
* [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=mac)
* [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
* JDK8
* Maven

## Prevision Azure Resources required to run this sample.

### Authenticate using the Azure CLI

Terraform must authenticate to Azure to create infrastructure.

In your terminal, use the Azure CLI tool to setup your account permissions locally.
Expand Down Expand Up @@ -51,6 +51,7 @@ You have logged in. Now let us find all the subscriptions to which you have acce
```

If you have more than one subscriptions, specify the subscription-id you want to use with command below:

```shell
az account set --subscription <your-subscription-id>
```
Expand All @@ -71,9 +72,6 @@ terraform -chdir=./terraform apply

```




It may take a few minutes to run the script. After successful running, you will see prompt information like below:

```shell
Expand All @@ -94,12 +92,12 @@ AZURE_SERVICEBUS_NAMESPACE_01 = "${YOUR_SERVICEBUS_NAMESPACE_01}"
AZURE_SERVICEBUS_NAMESPACE_02 = "${YOUR_SERVICEBUS_NAMESPACE_02}"
AZURE_SERVICEBUS_NAMESPACE_03 = "${YOUR_SERVICEBUS_NAMESPACE_03}"


```

You can go to [Azure portal](https://ms.portal.azure.com/) in your web browser to check the resources you created.

### Export output to your local Environment

Running the command below to export environment values:

```shell
Expand All @@ -108,31 +106,32 @@ Running the command below to export environment values:

## Run locally

In your terminal, run `mvn clean spring-boot:run`.

In your terminal, run `mvn clean spring-boot:run` .

```shell
# in the root directory of the sample
mvn clean spring-boot:run
```


## Verify this sample

Send a POST request to service bus queue

```shell
$ curl -X POST http://localhost:8080/queues?message=hello
```

Verify in your app’s logs that a similar message was posted:

```shell
Message was sent successfully for queue1.
New message received: 'hello'
Message 'hello' successfully checkpointed
Message was sent successfully for queue2.
```


## Clean up Resources

After running the sample, if you don't want to run the sample, remember to destroy the Azure resources you created to avoid unnecessary billing.

The terraform destroy command terminates resources managed by your Terraform project.
Expand All @@ -141,6 +140,3 @@ To destroy the resources you created.
```shell
terraform -chdir=./terraform destroy
```



Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
This guide walks you through the process of accessing Servicebus Queues and Topics with Spring Integration.

## What You Will build

You will build an application that use Azure Servicebus Queues and Topics to send and receive messages withs [Spring Integration](https://spring.io/projects/spring-integration) APIs.

## What You Need

- [An Azure subscription](https://azure.microsoft.com/en-us/free/)
- [Terraform](https://www.terraform.io/)
- [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=mac)
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
- JDK8
- Maven
* [An Azure subscription](https://azure.microsoft.com/en-us/free/)
* [Terraform](https://www.terraform.io/)
* [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=mac)
* [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
* JDK8
* Maven

## Prevision Azure Resources required to run this sample.

### Authenticate using the Azure CLI

Terraform must authenticate to Azure to create infrastructure.

In your terminal, use the Azure CLI tool to setup your account permissions locally.
Expand Down Expand Up @@ -49,6 +51,7 @@ You have logged in. Now let us find all the subscriptions to which you have acce
```

If you have more than one subscriptions, specify the subscription-id you want to use with command below:

```shell
az account set --subscription <your-subscription-id>
```
Expand All @@ -68,9 +71,6 @@ terraform -chdir=./terraform apply

```




It may take a few minutes to run the script. After successful running, you will see prompt information like below:

```shell
Expand All @@ -92,6 +92,7 @@ SERVICEBUS_NAMESPACE = "${YOUR_SERVICEBUS_NAMESPACE}"
You can go to [Azure portal](https://ms.portal.azure.com/) in your web browser to check the resources you created.

### Export output to your local Environment

Running the command below to export environment values:

```shell
Expand All @@ -100,8 +101,7 @@ Running the command below to export environment values:

## Run locally

In your terminal, run `mvn clean spring-boot:run`.

In your terminal, run `mvn clean spring-boot:run` .

```shell
mvn clean spring-boot:run
Expand All @@ -110,23 +110,21 @@ mvn clean spring-boot:run
## Verify this sample

1. Send a POST request to service bus queue

$ curl -X POST http://localhost:8080/queues?message=hello

2. Verify in your app’s logs that a similar message was posted:

New message received: 'hello'
Message 'hello' successfully checkpointed
3. Send a POST request to service bus topic

3. Send a POST request to service bus topic
$ curl -X POST http://localhost:8080/topics?message=hello

4. Verify in your app’s logs that a similar message was posted:

New message received: 'hello'
Message 'hello' successfully checkpointed

## Clean up Resources

After running the sample, if you don't want to run the sample, remember to destroy the Azure resources you created to avoid unnecessary billing.

The terraform destroy command terminates resources managed by your Terraform project.
Expand All @@ -135,7 +133,3 @@ To destroy the resources you created.
```shell
terraform -chdir=./terraform destroy
```




0 comments on commit 7ee7b77

Please sign in to comment.