Example of sending a map message to a JMS destination
The following example shows how to send a map message to a Java™ Message Service (JMS) destination by using the SendJMSMessage function.
// Set JMSDataSource to a valid and existing JMSDataSource in Impact.
// The destination where the message is sent is obtained from the JMSDataSource.
JMSDataSource = “JMSDS1”;
// Create a message properties object and populate its
// member variables with message header properties and custom properties
MsgProps = NewObject();
MsgProps.TimeToLive = 0;
MsgProps.color = "green";
MsgProps.Expiration = 2000;
MsgProps.DeliveryMode = "PERSISTENT";
MsgProps.ReplyTo="queue2";
// Specify custom message properties
MsgProps.Custom1 = "Value 1";
MsgProps.Custom2 = "Value 2";
// Create a map message content and populate its member
// variables where each variable and value represent a name/
// value pair for the resulting map
MsgMapBody = NewObject();
MsgMapBody.name = "sanjay";
MsgMapBody.location = "New York City";
MsgMapBody.facility = "Wall St.";
// Call SendJMSMessage and pass the JNDI properties
// context, the message properties context, the message
// map context and other parameters
SendJMSMessage(JMSDataSource, MsgProps, MsgMapBody);