mirror of https://github.com/apache/activemq.git
applied fix for AMQ-1232 and AMQ-1275
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@546847 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4474eb8a1b
commit
28e6453bad
|
@ -1594,23 +1594,12 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
||||||
// tell the Broker we are about to start a new transaction
|
// tell the Broker we are about to start a new transaction
|
||||||
doStartTransaction();
|
doStartTransaction();
|
||||||
TransactionId txid=transactionContext.getTransactionId();
|
TransactionId txid=transactionContext.getTransactionId();
|
||||||
message.setJMSDestination(destination);
|
|
||||||
message.setJMSDeliveryMode(deliveryMode);
|
|
||||||
long expiration=0L;
|
|
||||||
if(!producer.getDisableMessageTimestamp()){
|
|
||||||
long timeStamp=System.currentTimeMillis();
|
|
||||||
message.setJMSTimestamp(timeStamp);
|
|
||||||
if(timeToLive>0){
|
|
||||||
expiration=timeToLive+timeStamp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
message.setJMSExpiration(expiration);
|
|
||||||
message.setJMSPriority(priority);
|
|
||||||
long sequenceNumber=producer.getMessageSequence();
|
long sequenceNumber=producer.getMessageSequence();
|
||||||
message.setJMSRedelivered(false);
|
|
||||||
// transform to our own message format here
|
// transform to our own message format here
|
||||||
ActiveMQMessage msg=ActiveMQMessageTransformation.transformMessage(
|
ActiveMQMessage msg=ActiveMQMessageTransformation.transformMessage(
|
||||||
message,connection);
|
message,connection);
|
||||||
|
|
||||||
// Set the message id.
|
// Set the message id.
|
||||||
if(msg==message){
|
if(msg==message){
|
||||||
msg.setMessageId(new MessageId(producer.getProducerInfo()
|
msg.setMessageId(new MessageId(producer.getProducerInfo()
|
||||||
|
@ -1620,6 +1609,21 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
|
||||||
.getProducerId(),sequenceNumber));
|
.getProducerId(),sequenceNumber));
|
||||||
message.setJMSMessageID(msg.getMessageId().toString());
|
message.setJMSMessageID(msg.getMessageId().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg.setJMSDestination(destination);
|
||||||
|
msg.setJMSDeliveryMode(deliveryMode);
|
||||||
|
long expiration=0L;
|
||||||
|
if(!producer.getDisableMessageTimestamp()){
|
||||||
|
long timeStamp=System.currentTimeMillis();
|
||||||
|
msg.setJMSTimestamp(timeStamp);
|
||||||
|
if(timeToLive>0){
|
||||||
|
expiration=timeToLive+timeStamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg.setJMSExpiration(expiration);
|
||||||
|
msg.setJMSPriority(priority);
|
||||||
|
msg.setJMSRedelivered(false);
|
||||||
|
|
||||||
msg.setTransactionId(txid);
|
msg.setTransactionId(txid);
|
||||||
if(connection.isCopyMessageOnSend()){
|
if(connection.isCopyMessageOnSend()){
|
||||||
msg=(ActiveMQMessage)msg.copy();
|
msg=(ActiveMQMessage)msg.copy();
|
||||||
|
|
Loading…
Reference in New Issue