How to set a JMS Request to Payload Empty?
- 7 years ago
I could not to implement in SoapUI Request interface a JMS Message with JMS Type Simple.
I wrote this code in Groovy to send this JMS Message.
import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder;
import com.eviware.soapui.impl.wsdl.submit.transports.jms.util.HermesUtils;
import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSEndpoint;
import hermes.Hermes;
import javax.jms.*;
def jmsEndpoint = new JMSEndpoint("<JMS_ENDPOINT>");
def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName);
def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null ,null ,null);
Session queueSession = jmsConnectionHolder.getSession();
Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );
Queue queueBrowse = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getReceive() );
MessageProducer messageProducer =queueSession.createProducer( queueSend );//This part you create a message by JMS Type
Message messageSend = queueSession.createMessage();// This part you can set a JMS Property
messageSend.setBooleanProperty("<Property_Name>", true);
messageSend.setStringProperty("<Property_Name>", "<VALUE>");messageProducer.send(messageSend);