连接到 Azure 存储器
连接到 Azure Storage 队列提供程序服务器。
命令可用性: 本地 IBM RPA SaaS 和 IBM RPA
Description
连接到 Azure Storage 队列提供程序服务器。 您可以通过启用 Storaged Configurations 选项来使用现有 Azure Storage 连接,或者通过将其保持禁用状态来手动配置该连接。
脚本语法
IBM RPA 的专有脚本语言的语法与其他编程语言类似。 该脚本语法在脚本文件中定义命令的语法。 您可以在 IBM RPA Studio的 脚本 方式下使用此语法。
connectActiveMQ --queueprovider(String) --address(String) [--fromconfiguration(Boolean)] [--port(Numeric)] [--timeout(TimeSpan)] (Boolean)=success (QueueConnection)=value
依赖关系
- 您必须具有对公开队列服务的服务器的访问权。 对于 Azure Storage,在使用此命令之前,必须具有对现有 Azure Storage 服务器的访问权。
- 如果启用
Storaged Configurations参数,那么必须在 IBM RPA Control Center中具有先前配置的队列提供程序。 请参阅队列提供程序以获取更多信息。
输入参数
下表显示了此命令中提供的输入参数的列表。 在表中,您可以看到在 IBM RPA Studio的脚本方式及其 Designer 方式等效标签中工作时的参数名称。
| 设计器方式标签 | 脚本方式名称 | 必需的 | 接受的变量类型 | Description |
|---|---|---|---|---|
| 队列提供程序 | queueprovider |
Required when the Storage Configurations parameter is enabled |
Text |
连接到在 IBM RPA Control Center中配置的队列提供程序。 仅当队列提供程序已在 IBM RPA Control Center中注册时,此选项才有效。 |
| 开发环境 | isdevelopment |
Required when the Storage Configurations parameter is not enabled |
Boolean |
启用后,它支持将本地机器用作开发环境。 |
| 帐户名称 | accountname |
Required when the Development Environment parameter is not enabled |
Text |
用于访问队列服务器的帐户名称。 |
| 帐户密钥 | accountkey |
Required when the Development Environment parameter is not enabled |
Text |
用于访问队列服务器的帐户密码或密钥。 |
| 协议 | protocol |
Required when the Development Environment parameter is not enabled |
EndpointsProtocol |
用于向队列服务器发送信息的协议选项。 请参阅 protocol 参数选项中的选项。 |
| 超时 | timeout |
Optional |
Time Span |
建立与队列服务器的连接的最长等待时间。 如果未定义任何值,那么将使用缺省超时值 5 秒。 它还可以使用设置超时 ( setTimeout) 命令中定义的超时值。 |
| 存储的配置 | fromconfiguration |
Optional |
Boolean |
启用后,您可以选择先前在 IBM RPA Control Center中配置的队列提供程序。 |
protocol 参数选项
下表显示了可用于 protocol 输入参数的选项。 该表显示了在脚本方式下工作时的可用选项以及在设计器方式下的等效标签。
| 设计器方式标签 | 脚本方式名称 | Description |
|---|---|---|
| HTTP | http |
用于连接到队列服务器的 HTTP 协议。 |
| HTTPS | https |
用于连接到队列服务器的 HTTPS 协议。 |
输出参数
| 设计器方式标签 | 脚本方式名称 | 接受的变量类型 | Description |
|---|---|---|---|
| 成功 | success |
Boolean |
如果成功建立与服务器的连接,那么返回 True;否则返回 False。 |
| 连接 | value |
Queue Connection |
通过与队列提供程序的连接返回一个变量。 |
示例
以下示例连接到 Azure Storage 队列服务器,使用获取队列 (getQueue) 命令获取 Clients 队列,并使用出队 (dequeue) 命令从队列中除去第一个项。
defVar --name azureStorageConnection --type QueueConnection
defVar --name clientsQueue --type MessageQueue
// Connects to Azure Storage in a Development Environment
connectAzureStorage --isdevelopment azureStorageConnection=value
// Getes the Clients queue
getQueue --connection ${azureStorageConnection} --name Clients clientsQueue=value
// Removes the first item from the queue
dequeue --collection "${clientsQueue}"
限制
- 此命令不会创建新队列。 您可以通过创建类型为
Message Queue的新变量并使用 入队 (enqueue) 命令将项添加到队列,或者通过获取先前在 IBM RPA Control Center中注册的队列来创建新队列。