mirror of https://github.com/apache/activemq.git
Fixes AMQ-5002: Support receiving AMQP messages which do not have the timestamp set but the expiration is set.
This commit is contained in:
parent
e0e14e087b
commit
875822de51
|
@ -566,6 +566,16 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
|
|||
message.setTransactionId(new LocalTransactionId(connectionId, txid));
|
||||
}
|
||||
|
||||
// Lets handle the case where the expiration was set, but the timestamp
|
||||
// was not set by the client. Lets assign the timestamp now, and adjust the
|
||||
// expiration.
|
||||
if( message.getExpiration()!= 0 ) {
|
||||
if( message.getTimestamp()==0 ) {
|
||||
message.setTimestamp(System.currentTimeMillis());
|
||||
message.setExpiration(message.getTimestamp()+message.getExpiration());
|
||||
}
|
||||
}
|
||||
|
||||
message.onSend();
|
||||
sendToActiveMQ(message, new ResponseHandler() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue