boolean mandatory, boolean immediate, boolean wait) throws JMSException
{
checkTemporaryDestination(destination);
origMessage.setJMSDestination(destination);
AbstractJMSMessage message = convertToNativeMessage(origMessage);
if (_transacted)
{
if (_session.hasFailedOver() && _session.isDirty())
{
throw new JMSAMQException("Failover has occurred and session is dirty so unable to send.",
new AMQSessionDirtyException("Failover has occurred and session is dirty " +
"so unable to send."));
}
}
UUID messageId = null;
if (_disableMessageId)
{
message.setJMSMessageID((UUID)null);
}
else
{
messageId = _messageIdGenerator.generate();
message.setJMSMessageID(messageId);
}
sendMessage(destination, origMessage, message, messageId, deliveryMode, priority, timeToLive, mandatory, immediate, wait);
if (message != origMessage)
{
_logger.debug("Updating original message");
origMessage.setJMSPriority(message.getJMSPriority());
origMessage.setJMSTimestamp(message.getJMSTimestamp());
_logger.debug("Setting JMSExpiration:" + message.getJMSExpiration());
origMessage.setJMSExpiration(message.getJMSExpiration());
origMessage.setJMSMessageID(message.getJMSMessageID());
}
if (_transacted)
{
_session.markDirty();