forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
181 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
...e-spring-boot-samples/azure-spring-integration-sample-storage-queue/README.adoc
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
...ure-spring-boot-samples/azure-spring-integration-sample-storage-queue/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Spring Cloud Azure Storage Queue Integration Code Sample shared library for Java | ||
|
||
## Key concepts | ||
|
||
This code sample demonstrates how to use Spring Integration for Azure Storage Queue. | ||
|
||
## Getting started | ||
|
||
Running this sample will be charged by Azure. You can check the usage and bill at | ||
[this link][azure-account]. | ||
|
||
### Environment checklist | ||
|
||
We need to ensure that this [environment checklist][ready-to-run-checklist] is | ||
completed before the run. | ||
|
||
### Create Azure resources | ||
|
||
1. Create [Azure Storage][create-azure-storage]. | ||
|
||
1. **[Optional]** if you want to use service principal, please follow | ||
[create service principal from Azure CLI][create-sp-using-azure-cli] to create one. | ||
|
||
1. **[Optional]** if you want to use managed identity, please follow | ||
[create managed identity][create-managed-identity] to set up managed identity. | ||
|
||
## Examples | ||
|
||
1. Update stream binding related properties in | ||
[application.yaml](src/main/resources/application.yaml). If you choose to use | ||
service principal or managed identity, update the `application-sp.yaml` or | ||
`application-mi.yaml` respectively. | ||
|
||
```yaml | ||
spring: | ||
cloud: | ||
azure: | ||
storage: | ||
account: [storage-account-name] | ||
access-key: [storage-account-access-key] | ||
``` | ||
2. Update queue name in | ||
[SendController.java][send-controller] and | ||
[ReceiveController.java][receive-controller]. | ||
1. Run the `mvn spring-boot:run` in the root of the code sample to get | ||
the app running. | ||
|
||
1. Send a POST request | ||
|
||
$ curl -X POST localhost:8080/messages?message=hello | ||
|
||
1. Receive the message you posted | ||
|
||
$ curl -X GET localhost:8080/messages | ||
|
||
1. Verify in your app’s logs that a similar message was posted: | ||
|
||
New message received: 'hello' | ||
Message 'hello' successfully checkpointed | ||
|
||
1. Delete the resources on [Azure Portal][azure-portal] to avoid unexpected charges. | ||
|
||
|
||
## Troubleshooting | ||
|
||
## Next steps | ||
|
||
## Contributing | ||
|
||
<!-- LINKS --> | ||
|
||
[azure-account]: https://azure.microsoft.com/account/ | ||
[azure-portal]: http://ms.portal.azure.com/ | ||
[create-azure-storage]: https://docs.microsoft.com/azure/storage/ | ||
[create-managed-identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/create-managed-identity.md | ||
[create-sp-using-azure-cli]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/create-sp-using-azure-cli.md | ||
[ready-to-run-checklist]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/README.md#ready-to-run-checklist | ||
[send-controller]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-integration-sample-storage-queue/src/main/java/com/azure/spring/sample/storage/queue/SendController.java | ||
[receive-controller]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-samples/azure-spring-integration-sample-storage-queue/src/main/java/com/azure/spring/sample/storage/queue/ReceiveController.java | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ples/azure-spring-integration-sample-storage-queue/src/main/resources/application-mi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
spring: | ||
cloud: | ||
azure: | ||
msi-enabled: true | ||
managed-identity: | ||
client-id: [the-id-of-managed-identity] | ||
resource-group: [resource-group] | ||
subscription-id: [subscription-id] | ||
storage: | ||
account: [storage-account] |
9 changes: 9 additions & 0 deletions
9
...ples/azure-spring-integration-sample-storage-queue/src/main/resources/application-sp.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
spring: | ||
cloud: | ||
azure: | ||
client-id: [service-principal-id] | ||
client-secret: [service-principal-secret] | ||
tenant-id: [tenant-id] | ||
resource-group: [resource-group] | ||
storage: | ||
account: [storage-account] |
13 changes: 0 additions & 13 deletions
13
...s/azure-spring-integration-sample-storage-queue/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...samples/azure-spring-integration-sample-storage-queue/src/main/resources/application.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring: | ||
cloud: | ||
azure: | ||
storage: | ||
account: [storage-account] | ||
access-key: [storage-account-access-key] |