Azure Storage Queue Plugin
The plugin provides functionality to interact with Storage Queue
Installation
-
Copy the below line to
dependencies
section of the projectbuild.gradle
filePlease make sure to use the same version for all VIVIDUS dependencies. Example 1. build.gradleimplementation(group: 'org.vividus', name: 'vividus-plugin-azure-storage-queue', version: '0.6.2')
-
If the project was imported to the IDE before adding new dependency, re-generate the configuration files for the used IDE and then refresh the project in the used IDE.
Configuration
Authentication
The authentication process relies on the configuration of the environment variables.
See the official "Azure identity" guide to get more details on what types of authentication could be used.
Properties
The storage queues endpoints are configured with the following property format:
azure.storage-queue.<key>=<endpoint>
where:
-
key
- The logical key used to refer storage queue in the steps. -
endpoint
- The queue service URL, e.g.https://storageaccount.queue.core.windows.net/
. It’s allowed to use queue service SAS URL here, in this case the authentication configuration is not required.
Steps
Peek messages
Peeks messages from the front of the queue up to the maximum number of messages.
When I peek up to `$maxMessagesNumber` messages from queue `$storageQueueKey` and save result to $scopes variable `$variableName`
-
$maxMessagesNumber
- The maximum number of messages to peek, if there are less messages exist in the queue than requested all the messages will be peeked. The allowed range is 1 to 32 messages. -
$storageQueueKey
- The key of storage queue from the configuration. -
$variableName
- The variable name to store the list of found message bodies. The messages are accessible via zero-based index, e.g. <code>${my-keys[0]}</code> will return the first found message body.
When I peek up to `5` messages from queue `users` and save result to scenario variable `messages`
Then `{"name" : "azure"}` is equal to `${messages[0]}`
Send message
Sends message to the queue
When I send message `$message` to queue `$storageQueueKey` and save result as JSON to $scopes variable `$variableName`
-
$message
- The message to send -
$storageQueueKey
- The key of storage queue from the configuration. -
$variableName
- The name of the variable to save the send message result in JSON format.
When I send message `{
"id": "1807",
"eventType": "CreateUser",
"subject": "myapp/vehicles/motorcycles",
"eventTime": "2021-03-22T12:44:07+00:00",
"data": {
"make": "lada",
"model": "xray"
},
"dataVersion": "1.0"
}` to queue `users` and save result as JSON to scenario variable `result`