Forum Discussion
I have also tried to make a script in groovy:
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.*
//Establishing the JMS connection
def jmsEndpoint = new JMSEndpoint("jms://SIAAM::queue_COLAMQ1");
def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName)
def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null, null, null);
// Obtaining the session and queue
Session queueSession = jmsConnectionHolder.getSession();
Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );
Queue queueBrowse = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getReceive() );
// Performing some actions
MessageProducer messageProducer = queueSession.createProducer( queueSend );
TextMessage textMessageSend = queueSession.createTextMessage();
textMessageSend.setJMSCorrelationID('PEPEP')
textMessageSend.setJMSMessageID("PEPEITO")
textMessageSend.setText( """
<?xml version="1.0" encoding="ISO-8859-1"?>
<PEPE_E2E>
</PEPE_E2E>
""");
messageProducer.send( textMessageSend );
// Logging elements
QueueBrowser qb = queueSession.createBrowser(queueBrowse);
Enumeration en = qb.getEnumeration();
while(en.hasMoreElements())
{
TextMessage tm = (TextMessage)en.nextElement();
log.info tm.getText()
}
jmsConnectionHolder.closeAll() // Make sure to close the session and connection
I can modify JMSCorrelationID, but I can't modify JMSMessageID
Related Content
- 8 years ago
- 9 years ago
- 10 years ago
Recent Discussions
- 15 years ago