Share this page

# jms_receive_message_topic

Receives published messages to a specific topic on a subscription.

Example: jms_publish_message_topic and jms_receive_message_topic | Web Services Functions (SOAP, WEB_SERVICE, Silverlight)

    int jms_receive_message_topic( const char * StepName, const char * SubscriberName, const char * TopicName );

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure. Note that LR_PASS and LR_FAIL generally indicate whether the function call completed without an exception, and not that the test step succeeded.

All input string arguments (char type) except the step name can be parameterized using standard parameterization.

StepName | The name of the step, as it appears in the test tree. Any text can be used.
SubscriberName | The name of the subscription. Use the same subscriber name value from the previously-called jms_subscribe_topic.
TopicName | The JNDI name of the topic from which to receive the message.

The jms_receive_message_topic function receives messages synchronously on a topic for a subscription.

VuGen identifies the topic and subscription by calling a lookup method on a JNDI context defined in the JMS runtime settings.

Call this function after jms_subscribe_topic. Use the same SubscriberName value from the jms_subscribe_topic call.

To filter received messages, set a JMSSelector message header by calling jms_set_message_property, making sure to insert the selector before the jms_subscribe_topic call. The filter applies to all messages received during the duration of the subscription.

When received, the message is saved in a VuGen output parameter called JMS_message.

This function fails, causing the script to stop (if the Continue on Error runtime setting is not selected) if:

- The JNDI context is incorrect.

- The topic cannot be located.

- No message arrives after the timeout configured in the runtime settings.

- A communication error occurs.

- SubscriberName does not match any subscription (as defined in jms_subscribe_topic).

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: