thomas.darimont
Aug 23rd, 2005, 07:15 AM
Hello,
does anybody know whether there is a way, to get the JMSMessageID after the Message is handed over to the "native" JMS transfer mechanism (jbossmq client) by using the JMSTemplate?
At the time I use this ugly hack:
public void sendPrintRequestFor(final PrintJob printJob) {
//Ugly Hack to get the JMSMessageID
final Message[] messageContainer = new Message[1];
getJmsTemplate().convertAndSend(printJob, new MessagePostProcessor() {
public Message postProcessMessage(Message message)
throws JMSException {
messageContainer[0] = message;
return message;
}
});
try {
printJob.setJobID(messageContainer[0].getJMSMessag eID());
} catch (JMSException e) {
throw new IllegalStateException(e);
}
}
So long,
Thomas
does anybody know whether there is a way, to get the JMSMessageID after the Message is handed over to the "native" JMS transfer mechanism (jbossmq client) by using the JMSTemplate?
At the time I use this ugly hack:
public void sendPrintRequestFor(final PrintJob printJob) {
//Ugly Hack to get the JMSMessageID
final Message[] messageContainer = new Message[1];
getJmsTemplate().convertAndSend(printJob, new MessagePostProcessor() {
public Message postProcessMessage(Message message)
throws JMSException {
messageContainer[0] = message;
return message;
}
});
try {
printJob.setJobID(messageContainer[0].getJMSMessag eID());
} catch (JMSException e) {
throw new IllegalStateException(e);
}
}
So long,
Thomas