Get Queue
Gets the specified queue from the queue provider.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Gets a specified queue from the queue provider. You can get queues registered in the IBM RPA Control Center, or queues from your queue providers. This command can also create the queue if it doesn't exist.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
getQueue --connection(QueueConnection) [--fromconfiguration(Boolean)] --queue(String) --name(String) (Boolean)=success (MessageQueue)=value
Dependencies
- You need an active connection to a queue server. The following commands can be used to connect to a queue server:
- Connect to Active MQ (
connectActiveMQ
) - Connect to Azure Storage (
connectAzureStorage
) - Connect to IBM MQ (
connectIbmMQ
) - Connect to JMS MQ (
connectJmsMQ
) - Connect to Microsoft MQ (
connectMicrosoftMQ
) - Connect to Rabbit MQ (
connectRabbitMQ
) - Connect to SQL MQ (
connectSqlMQ
) - Connect to IBM RPA Queue Server (
connectSystemMQ
)
- Connect to Active MQ (
- You need an existing queue's name. The name is unique and it is used to identify the queue.
- If the queue does not exist, the command tries to create a new queue with the given name. See the Limitations section for limitations related to the name of the queue.
- If the
Storaged Configuration
parameter is enabled, ensure that the queue is registered in the IBM RPA Control Center.
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Queue Connection | connection |
Required |
Queue Connection |
Connection variable with the queue provider. |
Storaged Configuration | fromconfiguration |
Optional |
Boolean |
When enabled, you can select a queue previously configured in the IBM RPA Control Center. |
Queue | queue |
Required when the Storaged Configuration parameter is enabled |
Text |
Name of the queue that is already registered in the IBM RPA Control Center. |
Name | name |
Required when the Storaged Configuration parameter is not enabled |
Text |
Name to identify the queue. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Success | success |
Boolean |
Returns True if the queue was successfully obtained, or False otherwise. |
Queue Obtained | value |
Message Queue |
Returns a variable with the specified queue. |
Example
After connecting to the queue provider, the queue is obtained from the server, and the Log Message (logMessage
) command displays the obtained queue in the IBM RPA Studio's
console.
defVar --name queueConnection --type QueueConnection
defVar --name obtainedQueue --type MessageQueue
connectActiveMQ --queueprovider Training --fromconfiguration queueConnection=value
getQueue --connection ${queueConnection} --name Return obtainedQueue=value
logMessage --message "Queue obtained from the queue provider:${obtainedQueue}" --type "Info"
Limitations
If the command tries to create a new queue, the queue name must not contain underscores (_
). Some queue providers do not support this character, and fail to create a new queue with the given name.