List of usage examples for javax.jms ObjectMessage setJMSMessageID
void setJMSMessageID(String id) throws JMSException;
From source file:eu.learnpad.simulator.mon.probe.GlimpseAbstractProbe.java
/** * This method send a {@link GlimpseBaseEvent} message on the ESB<br /> * specifically on the channel specified in the {@link #settings} object. * //w w w.j a v a 2 s. co m * @param event the event to send * @param debug * @throws JMSException * @throws NamingException */ protected void sendEventMessage(GlimpseBaseEventAbstract<?> event, boolean debug) throws JMSException, NamingException { if (debug) { DebugMessages.print(TimeStamp.getCurrentTime(), this.getClass().getSimpleName(), "Creating Message "); } try { ObjectMessage messageToSend = publishSession.createObjectMessage(); messageToSend.setJMSMessageID(String.valueOf(MESSAGEID++)); messageToSend.setObject(event); if (debug) { DebugMessages.ok(); DebugMessages.print(TimeStamp.getCurrentTime(), this.getClass().getSimpleName(), "Publishing message "); } tPub.publish(messageToSend); if (debug) { DebugMessages.ok(); DebugMessages.line(); } } catch (JMSException e) { e.printStackTrace(); } }