Example usage for javax.jms ObjectMessage setJMSCorrelationID

List of usage examples for javax.jms ObjectMessage setJMSCorrelationID

Introduction

In this page you can find the example usage for javax.jms ObjectMessage setJMSCorrelationID.

Prototype


void setJMSCorrelationID(String correlationID) throws JMSException;

Source Link

Document

Sets the correlation ID for the message.

Usage

From source file:org.oxymores.chronix.engine.Runner.java

public void getParameterValue(RunDescription rd, PipelineJob pj, UUID paramId) throws JMSException {
    // Always send to the node, not its hosting node.
    Place p = pj.getPlace(ctx);//from   ww  w .  ja va2  s  .c  om
    String qName = String.format(Constants.Q_RUNNER, p.getNode().getBrokerName());
    log.info(String.format("A command for parameter resolution will be sent for execution on queue %s (%s)",
            qName, rd.getCommand()));
    Destination destination = jmsSession.createQueue(qName);

    ObjectMessage m = jmsSession.createObjectMessage(rd);
    m.setJMSReplyTo(destEndJob);
    m.setJMSCorrelationID(pj.getId() + "|" + paramId);
    producerRunDescription.send(destination, m);
    jmsSession.commit();
}