mirror of https://github.com/apache/activemq.git
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:
commit
b9426d6c00
|
@ -367,6 +367,7 @@ 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 {
|
||||||
|
if (listener.hasSpace()) {
|
||||||
Message msg = (Message) wireFormat.unmarshal(new ByteSequence(data));
|
Message msg = (Message) wireFormat.unmarshal(new ByteSequence(data));
|
||||||
msg.getMessageId().setBrokerSequenceId(sequenceId);
|
msg.getMessageId().setBrokerSequenceId(sequenceId);
|
||||||
msg.getMessageId().setFutureOrSequenceLong(sequenceId);
|
msg.getMessageId().setFutureOrSequenceLong(sequenceId);
|
||||||
|
@ -374,6 +375,9 @@ public class JDBCMessageStore extends AbstractMessageStore {
|
||||||
listener.recoverMessage(msg);
|
listener.recoverMessage(msg);
|
||||||
trackLastRecovered(sequenceId, msg.getPriority());
|
trackLastRecovered(sequenceId, msg.getPriority());
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue