mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3473: add defensive null check for brokerservice and region broker in case of dup detection during initalisation or partially initialised test, pa is always eagerly created
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1306865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b137af4f8a
commit
81e1de95f8
|
@ -287,13 +287,17 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void rollbackStatsOnDuplicate(KahaDestination commandDestination) {
|
void rollbackStatsOnDuplicate(KahaDestination commandDestination) {
|
||||||
|
if (brokerService != null) {
|
||||||
RegionBroker regionBroker = (RegionBroker) brokerService.getRegionBroker();
|
RegionBroker regionBroker = (RegionBroker) brokerService.getRegionBroker();
|
||||||
|
if (regionBroker != null) {
|
||||||
Set<Destination> destinationSet = regionBroker.getDestinations(convert(commandDestination));
|
Set<Destination> destinationSet = regionBroker.getDestinations(convert(commandDestination));
|
||||||
for (Destination destination : destinationSet) {
|
for (Destination destination : destinationSet) {
|
||||||
destination.getDestinationStatistics().getMessages().decrement();
|
destination.getDestinationStatistics().getMessages().decrement();
|
||||||
destination.getDestinationStatistics().getEnqueues().decrement();
|
destination.getDestinationStatistics().getEnqueues().decrement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Location findMessageLocation(final String key, final KahaDestination destination) throws IOException {
|
private Location findMessageLocation(final String key, final KahaDestination destination) throws IOException {
|
||||||
return pageFile.tx().execute(new Transaction.CallableClosure<Location, IOException>() {
|
return pageFile.tx().execute(new Transaction.CallableClosure<Location, IOException>() {
|
||||||
|
|
Loading…
Reference in New Issue