use of org.apache.activemq.artemis.core.postoffice.Bindings in project activemq-artemis by apache.
the class MessageRedistributionTest method getRemoteQueueBinding.
private RemoteQueueBinding getRemoteQueueBinding(ActiveMQServer server) throws Exception {
ActiveMQServer remoteServer = server;
Bindings bindings = remoteServer.getPostOffice().getBindingsForAddress(new SimpleString("queues.testaddress"));
Collection<Binding> bindingSet = bindings.getBindings();
return getRemoteQueueBinding(bindingSet);
}
use of org.apache.activemq.artemis.core.postoffice.Bindings in project activemq-artemis by apache.
the class PostOfficeImpl method listQueuesForAddress.
@Override
public List<Queue> listQueuesForAddress(SimpleString address) throws Exception {
Bindings bindingsForAddress = getBindingsForAddress(address);
List<Queue> queues = new ArrayList<>();
for (Binding b : bindingsForAddress.getBindings()) {
if (b instanceof QueueBinding) {
Queue q = ((QueueBinding) b).getQueue();
queues.add(q);
}
}
return queues;
}
use of org.apache.activemq.artemis.core.postoffice.Bindings in project activemq-artemis by apache.
the class WildcardAddressManager method getBindingsForRoutingAddress.
@Override
public Bindings getBindingsForRoutingAddress(final SimpleString address) throws Exception {
Bindings bindings = super.getBindingsForRoutingAddress(address);
// this should only happen if we're routing to an address that has no mappings when we're running checkAllowable
if (bindings == null && !wildCardAddresses.isEmpty()) {
Address add = addAndUpdateAddressMap(address);
if (!add.containsWildCard()) {
for (Address destAdd : add.getLinkedAddresses()) {
Bindings b = super.getBindingsForRoutingAddress(destAdd.getAddress());
if (b != null) {
Collection<Binding> theBindings = b.getBindings();
for (Binding theBinding : theBindings) {
super.addMappingInternal(address, theBinding);
}
super.getBindingsForRoutingAddress(address).setMessageLoadBalancingType(b.getMessageLoadBalancingType());
}
}
}
bindings = super.getBindingsForRoutingAddress(address);
}
return bindings;
}
use of org.apache.activemq.artemis.core.postoffice.Bindings in project activemq-artemis by apache.
the class ActiveMQServerControlImpl method listBindingsForAddress.
@Override
public String listBindingsForAddress(String address) throws Exception {
checkStarted();
clearIO();
try {
final Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(address));
return bindings.getBindings().stream().map(Binding::toManagementString).collect(Collectors.joining(","));
} finally {
blockOnIO();
}
}
use of org.apache.activemq.artemis.core.postoffice.Bindings in project activemq-artemis by apache.
the class AddressControlImpl method getBindingNames.
@Override
public String[] getBindingNames() throws Exception {
clearIO();
try {
Bindings bindings = postOffice.getBindingsForAddress(addressInfo.getName());
String[] bindingNames = new String[bindings.getBindings().size()];
int i = 0;
for (Binding binding : bindings.getBindings()) {
bindingNames[i++] = binding.getUniqueName().toString();
}
return bindingNames;
} catch (Throwable t) {
throw new IllegalStateException(t.getMessage());
} finally {
blockOnIO();
}
}
Aggregations