Azure Storage Queue Plugin

The plugin provides functionality to interact with Storage Queue

Installation

  1. Copy the below line to dependencies section of the project build.gradle file

    Please make sure to use the same version for all VIVIDUS dependencies.
    Example 1. build.gradle
    implementation(group: 'org.vividus', name: 'vividus-plugin-azure-storage-queue', version: '0.6.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:

  1. key - The logical key used to refer storage queue in the steps.

  2. 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.

  • $scopes - The comma-separated set of the variables scopes.

  • $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.

Example 2. Peek the first five messages and validate the first message
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.

  • $scopes - The comma-separated set of the variables scopes.

  • $variableName - The name of the variable to save the send message result in JSON format.

Example 3. Send the message
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`

Clear the queue

Deletes all messages from the queue.

When I clear queue `$storageQueueKey`
  • $storageQueueKey - The key of storage queue from the configuration.

Example 4. Clear the queue
When I clear queue `users`