Creating physical RabbitMQ transport connections
In HCL OneTest™ API, creating a RabbitMQ transport involves creating a RabbitMQ transport broker resource, which provides information about connectivity to a physical RabbitMQ transport broker.
Before you begin
If you want to configure SSL for a RabbitMQ transport, you must have created an identity store in your project to store certificates.
About this task
A RabbitMQ transport broker is a server that exchanges messages between RabbitMQ transport clients.
Procedure
- Open the Physical View of the Architecture School perspective.
-
On the toolbar of the Physical View, click
.
The RabbitMQ Broker window is displayed.
Alternatively, open the Logical View, right-click a RabbitMQ transport connection, and click in the pop-up menu.
- Optional:
In the Name field, enter a name for the broker.
Note: Assigning a name helps to identify the broker if there are multiple RabbitMQ transport brokers in your project.
-
Click Settings, if necessary, to configure the settings that are used to
create the rule that defines which RabbitMQ transport
traffic to record.
The Broker settings enable you to specify basic settings of the broker.
The Broker settings are described in the following table:Table 1. RabbitMQ Broker window: Settings tab Option Description Host
The hostname or IP address of the computer that hosts the RabbitMQ transport broker to which you want to connect.
Port
By default, 5672 is displayed in this field because TCP/IP port 5671 is reserved with the Internet Assigned Numbers Authority (IANA) for use with the AMQP protocol.
TCP/IP port 5671 is reserved with the IANA for use with the RabbitMQ protocol over SSL (RabbitMQS).
However, 5672 and 5671 are only default values and the actual TCP/IP port number that you must enter in this field depends on the configuration of the physical RabbitMQ transport broker to which you want to connect.
Virtual host
Virtual hosts provide logical grouping and separation of resources. For example, the user permissions are managed by virtual host.
Timeout
Enter a timeout value, if needed, to set the number of milliseconds after which the subscriber stops waiting for the message (the default value 0, indicates that the subscriber waits indefinitely).
User
If the physical RabbitMQ transport broker requires a user name and password for authentication, enter the user name in the field provided.
Password
If the physical RabbitMQ transport broker requires a user name and password for authentication, enter the password in the field provided.
-
To associate the reply message from RabbitMQ with the
specific request message, you can specify any of the following semantics for the message:
Message semantic Description Use Queue to match responses to requests This option indicates that when this transport will be used to receive a message, the first message available on the target queue (specified into the configuration of the operation that use the transport) will be used. Use CorrelationID to match responses to requests This option filters messages in the reception queue specified by the operation that is using this transport by using CorrelationID to correlate responses with requests. CorrelationID is set as an extra message property. Use MessageID mapped to CorrelationID to match responses to requests This option filters messages in the reception queue specified by the operation that is using this transport mapping the MessageID to the CorrelationID to correlate responses with requests. MessageID is set as an extra message property. -
Click Properties and update the Name,
Type, and Value fields and click
OK.
You can send more properties in the header of the RabbitMQ messages. These properties can be used, for example, to let recipients decide which messages are presented to the receiving application.
-
Click SSL to configure the secure socket layer (SSL) settings for the
transport.
The SSL settings are described in the following table:
Table 2. RabbitMQ Broker window: SSL tab Setting Description Use SSL
Select this check box to enable security for the transport. When you select this check box, it makes the other controls on the SSL tab available. You can enable security for Testing (Client) or for Virtualization (Server), or both.
Server certificates to trust
All available identity stores are displayed in the drop-down menu. Select one of the following menu items:Option Description Trust All To accept any certificate presented by the server, regardless of its validity. This option is the default option, and assumes that you are focused on testing an application rather than the security of the server. New To define a new identity source. Identity store To specify an identity store that contains certificates that the client is to trust. Client identities to give to server
All available identity stores are displayed in the drop-down menu. If you use mutual authentication, a suitable identity is selected from the chosen identity store. Select one of the following menu items:Option Description None If the server does not request an identity. New To define a new identity source. Identity store To use an existing identity store. Specify an alias in the Identity field. Certificate source
All available identity stores are displayed in the drop-down menu. You can select one of the following menu items:Option Description Generated To use a certificate that HCL OneTest™ API generates for you. The source for that certificate is displayed in the Signed by field. New To define a new identity source. Identity store To use a certificate from an identity store. Signed by
If you chose Generated in the Certificate source field, this field holds the location of a certificate within the HCL OneTest™ API installation directory that is used to generate the new certificate. This is a read-only field.
Identity
If you specified an identity store in the Certificate source field, use this field to specify the alias of a key in that identity store.
Certificate Authorities a stub will trust
All available identity stores are displayed in the drop-down menu. You can select one of the following menu items:Option Description Trust All To accept any certificate presented by the client. New To define a new identity source. Identity store To specify an identity store that contains certificates that the stub is to trust. Override default protocols
If you are required to use a specific version of the SSL protocol, such as SSLv2 or TLSv1.2, enter that algorithm name here. For a complete list of algorithms, see Standard Algorithm Name Documentation.
Note: To complete the configuration of SSL for the transport, set the Port field under Settings to 5671. -
Click Recording to configure the proxy recording settings for the
broker.
In HCL OneTest™ API, RabbitMQ transport traffic is recorded by connecting to the RabbitMQ transport broker that you want to use and using the proxy recording technologies.
You can create tests and stubs from any events captured in the Recording Studio perspective. The Broker settings are described in the following table:Table 3. RabbitMQ Broker window: Recording tab Setting Description Queue Name
The proxy queue that must be recorded.
Exchange Name
The direct exchange name to which the queue will be bound to using the routing key if this is required. By default, this is not required.
Routing Key
The routing key value to be used when a direct exchange is specified. By default, this is not required.
Suffix
The suffix used for the proxy recording. It is mandatory to have a suffix and this value will be used by both the transport recording and operation/adhoc monitor recording that rely on this transport. Capture Exchange and Routing Key available information
The information to be captured during the monitoring, exchange, and routing key as expressed at runtime or the queue itself. Note that this option is only appropriate when the application writes messages to the proxy queue using a Direct, Fanout or Topic along with a routing key, wildcards, and exchange.
Remove the suffix from the captured Routing Key
When the Capture Exchange and Routing Key option is used, this option removes the suffix from the routing keys. This could be convenient when the end-user client application is only modified in terms of the routing key to be used, rather than in terms of the queue name to be used.
- Optional:
Click Stubbing to configure the mode used by the transport for routing
messages.
For RabbitMQ connection, the Stubbing Mode supports the Direct mode only. In this option, HCL OneTest™ API subscribes to a topic like any other RabbitMQ transport client and consumes messages directly.
- Click Test Transport to verify that the connection works.
- Click OK.
Results
The new physical RabbitMQ transport broker is added to your project.