JMS
Connect
The Connect JMS Advanced action is used to connect to a topic or a queue.
Supported JMS API versions: 1.1 and 2.0.
Note: NeoLoad does not include any JMS implementation JAR file. It must be downloaded from your JMS provider and put in the extlib
directory of your installation.
Parameters:
-
initialContextFactory (required): The fully qualified class name of the factory class that will create the initial context.
-
providerURL (required): The URL of the JMS provider.
-
connectionFactory (required): The name of the connection factory.
-
destination (required): The name of the (topic or queue) destination. It's used as the connection ID. A User Path cannot have two connections to a same destination.
-
username (optional): The username used to create the connection.
-
password (optional): The password used to create the connection.
-
sessionTransacted (optional): A boolean to indicate whether the session is transacted.
-
acknowledgeMode (optional): Indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values:
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE
-
jndiProperties (optional): JNDI properties to construct the initial context. The value must follow the pattern name=value separated by '\n'. Example: datasource=jdbc/aqjmsuserDataSource.
Examples
An example of an SSL connection to a Tibco queue:
-
initialContextFactory:
com.tibco.tibjms.TibjmsQueueConnectionFactory
-
providerURL:
ssl://tibco.example.com:7222
-
connectionFactory:
SSLQueueConnectionFactory
-
destination:
myQueueName
-
username:
userName
-
password:
password
jndiProperties: com.tibco.tibjms.naming.security_protocol=ssl,com.tibco.tibjms.naming.ssl_enable_verify_host=true,com.tibco.tibjms.naming.ssl_enable_verify_hostname=false,com.tibco.tibjms.naming.ssl_trusted_certs=${NL-CustomResources}/my_certificate.cer
Note: The SSL certificate must be placed in the ‘custom-resources' folder of the NeoLoad project. The ressources contained in this folder are automatically pasted into the Load Generators. The ${NL-CustomResources} variable is used to access this folder from the Load Generators.
An example of connecting to a Oracle Weblogic topic:
-
initialContextFactory:
weblogic.jndi.WLInitialContextFactory
-
providerURL:
t3://10.0.0.51:7001
-
connectionFactory:
myTopicFactory
-
destination:
myTopicName
-
username :
user
-
password:
password
Disconnect
The Disconnect JMS Advanced action is used to disconnect from a topic or a queue.
Parameter:
-
destination (required): The name of the (topic or queue) destination.
An example of disconnecting from a queue:
-
destination: myQueueName
Queue - Send
The Queue - Send JMS Advanced action is used to send a message to a queue.
Parameters:
-
queue (required): The name of the queue.
-
messageType (required): Text or Bytes.
-
textContent (optional): The message content.
-
contentFile.path (optional): The path of the content file. Use the variable '${NL-CustomResources}' to access on the Load Generator the synchronized resources located in the 'custom-resources' folder of the project.
-
contentFile.charset (optional): The charset of the file.
-
contentFile.parse (optional): Whether or not to parse the file to replace NeoLoad variables.
-
expiration (optional): The expiration time (in ms) before the message becomes obsolete. When set to default value (0) the message does not expire.
-
priority(optional): The priority of the message.
-
persistentDeliveryMode (optional): Whether or not to set DeliveryMode.NON_PERSISTENT.
-
properties (optional): You can setup the name, the value and the class (type) of value. Default type is String. The value must follow the pattern name=[class]value separated by "\\n".
Example :
JMSCorrelationID=${correlationID}\\ntest=${value
}.
Note: Click the pencil icon to add a row per property when editing in the multi-lines dialog.
Examples
An example of sending a message on a queue:
-
queue: myQueueName
-
messageType: Text
-
textContent: my content
-
properties: my_property=my_value
An example of sending a bytes message from a file:
-
queue: myQueueName
-
messageType: Bytes
-
contentFile.path: ${NL-CustomResources}\myfile
-
contentFile.parse: false
-
priority: 1
-
persistentDeliveryMode: false
-
properties: size=[java.lang.Integer]1500
Queue - Send and Receive
The Queue - Send and Receive JMS Advanced action is used to send a message. It waits for a response.
Parameters:
-
sendQueue (required): The name of the sending queue.
-
receiveQueue (optional): The name of the receiving queue. If not provided, a temporary queue created from the sending queue is used for receiving.
-
correlationID (optional except if parameter useRequestIdAsCorrelationId is set to false): The ID used to correlate messages.
-
messageType (required): Text or Bytes.
-
textContent (optional): The message content.
-
contentFile.path (optional): The path of the content file. Use the variable
${NL-CustomResources}
to access on the Load Generator the synchronized resources located in the 'custom-resources' folder of the project. -
contentFile.charset (optional): The charset of the file.
-
contentFile.parse (optional): Whether or not to parse the file to replace NeoLoad variables.
-
expiration (optional): The expiration time (in ms) before the message becomes obsolete. When set to default value (0) the message does not expire.
-
priority (optional): The priority of the message.
-
persistentDeliveryMode (optional): Whether or not to set
DeliveryMode.NON_PERSISTENT
. -
properties (optional): You can setup the name, the value and the class (type) of value. Default type is
String
. The value must follow the pattern name=[class]value separated by "\\n". -
Example:
size=[Integer]150
.Note: Click the pencil icon
to add a row per property when editing in the multi-lines dialog.
-
useRequestIdAsCorrelationId (optional): If set to true, the JMSMessageID request will be used for correlation, otherwise the JMSCorrelationID request will be used.
-
useResponseIdAsCorrelationId (optional): If set to true, the JMSMessageID response will be used for correlation, otherwise the JMSCorrelationID response will be used.
-
timeout (optional): Timeout (in ms) applied to wait a message. 0=none.
-
jmsSelector (optional): The message selector to extract only the message that respect the selector condition.
-
writeMessageInResponse (optional): Whether or not the response should contain the message.
-
failOnTimeout (optional): If set to true, the action fails when timeout is reached.
Examples
An example of send and receive on one queue:
-
sendQueue: myQueueName
-
correlationID : my_id
-
messageType: Text
-
textContent: my content
-
properties: my_property=my_value
-
timeout: 0
-
jmsSelector: my_property='my_value'
-
writeMessageInResponse: false
An example of send and receive on two queues:
-
sendQueue: mySendingQueueName
-
sendQueue: myReceivingQueueName
-
messageType: Text
-
textContent: my content
-
properties: my_property=my_value
-
useRequestIdAsCorrelationId: true
-
useResponseIdAsCorrelationId: true
-
timeout: 10000
-
jmsSelector: my_property='my_value'
Queue - Receive
The Queue - Receive JMS Advanced action is used to receive a message from a queue. It waits until the message is received.
Parameters:
-
queue (required): The queue name.
-
timeout (required): Timeout (in ms) applied to wait a message. 0=none.
-
jmsSelector (required): The message selector to extract only the message that respect the selector condition.
-
writeMessageInResponse (required): Whether or not the response should contain the message.
-
failOnTimeout (required): If set to true, the action fails when timeout is reached.
An example of receiving message:
-
queue: myQueueName
-
timeout: 5000
-
jmsSelector: my_property='my_value'
-
writeMessageInResponse: false
-
failOnTimeout: false
Topic - Subscribe
The Topic - Subscribe JMS Advanced action is used to subscribe to a topic.
Parameters:
-
topic (required): The topic name.
-
jmsSelector (optional): The message selector to only subscribe to messages respecting the selector condition.
-
includeLocal (optional): If set to true, messages published by same connection are included.
An example of topic subscription:
-
topic: myTopicName
-
jmsSelector: my_property='my_value'
-
includeLocal: false
Topic - Unsubscribe
The Topic - Unsubscribe JMS Advanced action is used to unsubscribe from a topic.
Parameter:
-
topic (required): The topic name.
An example of unsubscribing from a topic:
-
topic: myTopicName
Topic - Publish
The Topic - Publish JMS Advanced action is used to publish a message to a given topic.
Parameters:
-
topic (required): The topic name.
-
messageType (required): Text or Bytes.
-
textContent (optional): The message content.
-
contentFile.path (optional): The path of the content file. Use the variable '
${NL-CustomResources}
' to access on the Load Generator the synchronized resources located in the 'custom-resources' folder of the project. -
contentFile.charset (optional): The charset of the file.
-
contentFile.parse (optional): Whether or not to parse the file to replace NeoLoad variables.
-
expiration (optional): The expiration time (in ms) before the message becomes obsolete. When set to default value (0) the message does not expire.
-
priority (optional): The priority of the message.
-
persistentDeliveryMode (optional): Whether or not to set
DeliveryMode.NON_PERSISTENT
. -
properties (optional): You can setup the name, the value and the class (type) of value. Default type is String. The value must follow the pattern name=[class]value separated by "\\n".
Example:
size=[Integer]150
.
Note: Click the pencil icon to add a row per property when editing in the multi-lines dialog.
Examples
An example of sending a text message:
-
topic: myTopicName
-
messageType: Text
-
textContent: my content
An example of connecting to a Oracle Weblogic topic:
-
initialContextFactory: weblogic.jndi.WLInitialContextFactory
-
providerURL: t3://10.0.0.51:7001
-
connectionFactory: myTopicFactory
-
destination: myTopicName
-
username: user
-
password: password
Topic - Receive
The Topic - Receive JMS Advanced action is used to receive messages from a subscribed topic. It waits until the specified number of messages are received.
Parameters:
-
topic (required): The topic name.
-
numberOfMessages (optional): The number of message to receive.
-
timeout (optional): Timeout (in ms) applied to wait all messages. 0=none.
-
writeMessageInResponse (optional): Whether or not the response should contain the messages.
-
failOnTimeout (optional): If set to true, the action fails when timeout is reached.
An example of receiving 10 messages from a topic:
-
queue: myTopicName
-
timeout: 5000
-
numberOfMessages: 10