mirror of https://github.com/apache/activemq.git
avoid NPE I was getting in the web console
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@516401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba54ee86b2
commit
cb3becf3c4
|
@ -163,19 +163,21 @@ public class AMQTopicMessageStore extends AMQMessageStore implements TopicMessag
|
|||
this.ackedLastAckLocations=new HashMap<SubscriptionKey,MessageId>();
|
||||
}
|
||||
Location location=super.doAsyncWrite();
|
||||
transactionTemplate.run(new Callback(){
|
||||
|
||||
public void execute() throws Exception{
|
||||
// Checkpoint the acknowledged messages.
|
||||
Iterator<SubscriptionKey> iterator=cpAckedLastAckLocations.keySet().iterator();
|
||||
while(iterator.hasNext()){
|
||||
SubscriptionKey subscriptionKey=iterator.next();
|
||||
MessageId identity=cpAckedLastAckLocations.get(subscriptionKey);
|
||||
topicReferenceStore.acknowledge(transactionTemplate.getContext(),subscriptionKey.clientId,
|
||||
subscriptionKey.subscriptionName,identity);
|
||||
if (cpAckedLastAckLocations != null) {
|
||||
transactionTemplate.run(new Callback() {
|
||||
public void execute() throws Exception {
|
||||
// Checkpoint the acknowledged messages.
|
||||
Iterator<SubscriptionKey> iterator = cpAckedLastAckLocations.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SubscriptionKey subscriptionKey = iterator.next();
|
||||
MessageId identity = cpAckedLastAckLocations.get(subscriptionKey);
|
||||
topicReferenceStore.acknowledge(transactionTemplate.getContext(), subscriptionKey.clientId,
|
||||
subscriptionKey.subscriptionName, identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue