boolean mandatory, boolean immediate) throws JMSException
{
checkTemporaryDestination(destination);
origMessage.setJMSDestination(destination);
AbstractJMSMessage message = convertToNativeMessage(origMessage);
UUID messageId = null;
if (_disableMessageId)
{
message.setJMSMessageID((UUID)null);
}
else
{
messageId = _messageIdGenerator.generate();
message.setJMSMessageID(messageId);
}
try
{
sendMessage(destination, origMessage, message, messageId, deliveryMode, priority, timeToLive, mandatory, immediate);
}
catch (TransportException e)
{
throw getSession().toJMSException("Exception whilst sending:" + e.getMessage(), e);
}
if (message != origMessage)
{
_logger.debug("Updating original message");
origMessage.setJMSPriority(message.getJMSPriority());
origMessage.setJMSTimestamp(message.getJMSTimestamp());
if (_logger.isDebugEnabled())
{
_logger.debug("Setting JMSExpiration:" + message.getJMSExpiration());
}
origMessage.setJMSExpiration(message.getJMSExpiration());
origMessage.setJMSMessageID(message.getJMSMessageID());
}
if (_transacted)
{
_session.markDirty();