Merge pull request #494 from jbonofre/AMQ-7394

[AMQ-7394] Simple first fix to use listener.hasSpace() when recovering message from JDBC message store
This commit is contained in:
Jean-Baptiste Onofré 2020-03-03 17:13:00 +01:00 committed by GitHub
commit b9426d6c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -367,13 +367,17 @@ public class JDBCMessageStore extends AbstractMessageStore {
@Override @Override
public boolean recoverMessage(long sequenceId, byte[] data) throws Exception { public boolean recoverMessage(long sequenceId, byte[] data) throws Exception {
Message msg = (Message)wireFormat.unmarshal(new ByteSequence(data)); if (listener.hasSpace()) {
Message msg = (Message) wireFormat.unmarshal(new ByteSequence(data));
msg.getMessageId().setBrokerSequenceId(sequenceId); msg.getMessageId().setBrokerSequenceId(sequenceId);
msg.getMessageId().setFutureOrSequenceLong(sequenceId); msg.getMessageId().setFutureOrSequenceLong(sequenceId);
msg.getMessageId().setEntryLocator(sequenceId); msg.getMessageId().setEntryLocator(sequenceId);
listener.recoverMessage(msg); listener.recoverMessage(msg);
trackLastRecovered(sequenceId, msg.getPriority()); trackLastRecovered(sequenceId, msg.getPriority());
return true; return true;
} else {
return false;
}
} }
@Override @Override