Fixes AMQ-5002: Support receiving AMQP messages which do not have the timestamp set but the expiration is set.

This commit is contained in:
Hiram Chirino 2014-01-30 09:51:41 -05:00
parent e0e14e087b
commit 875822de51
1 changed files with 10 additions and 0 deletions

View File

@ -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