mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-03-03 07:49:24 +00:00
ARTEMIS-4814 Improve synchronization on SimpleAddressManager::getDirectBindings
This commit is contained in:
parent
229afee380
commit
dba753bffc
@ -178,7 +178,17 @@ public class SimpleAddressManager implements AddressManager {
|
||||
@Override
|
||||
public Collection<Binding> getDirectBindings(final SimpleString address) throws Exception {
|
||||
SimpleString realAddress = CompositeAddress.extractAddressName(address);
|
||||
return new ArrayList<>(directBindingMap.getOrDefault(realAddress, Collections.emptyList()));
|
||||
|
||||
ArrayList<Binding> outputList = new ArrayList<>();
|
||||
|
||||
directBindingMap.compute(realAddress, (key, bindings) -> {
|
||||
if (bindings != null) {
|
||||
outputList.addAll(bindings);
|
||||
}
|
||||
return bindings;
|
||||
});
|
||||
|
||||
return Collections.unmodifiableCollection(outputList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user