Instantiate a ConnectionFactory object and set its attribute values, for example:
QueueConnectionFactory myQConnFact =
new com.sun.messaging.QueueConnectionFactory();
|
Use the ConnectionFactory object to create a Connection object.
QueueConnection myQConn =
myQConnFact.createQueueConnection();
|
Use the Connection object to create a Session object.
QueueSession myQSess = myQConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
|
Instantiate a Message Queue Destination administered object corresponding to a physical destination in the Message Queue message service. In this example, the administered object is mySOAPQueue and the physical destination to which it refers is myPSOAPQ.
Queue mySOAPQueue = new com.sun.messaging.Queue("myPSOAPQ");
|
Use the MessageTransformer utility, as shown, to transform the SOAP message into a JMS message. For example, given a SOAP message named MySOAPMsg,
Message MyJMS = MessageTransformer.SOAPMessageIntoJMSMessage
(MySOAPMsg, MyQSess);
|
Create a QueueSender message producer.
This message producer, associated with mySOAPQueue, is used to send messages to the queue destination named myPSOAPQ.
QueueSender myQueueSender = myQSess.createSender(mySOAPQueue); |
Send a message to the queue.
myQueueSender.send(myJMS); |