Search in sources :

Example 1 with ConsumerView

use of org.apache.activemq.artemis.core.management.impl.view.ConsumerView in project activemq-artemis by apache.

the class ActiveMQServerControlImpl method listConsumers.

@Override
public String listConsumers(String options, int page, int pageSize) throws Exception {
    checkStarted();
    clearIO();
    try {
        Set<ServerConsumer> consumers = new HashSet();
        for (ServerSession session : server.getSessions()) {
            consumers.addAll(session.getServerConsumers());
        }
        ConsumerView view = new ConsumerView(server);
        view.setCollection(consumers);
        view.setOptions(options);
        return view.getResultsAsJson(page, pageSize);
    } finally {
        blockOnIO();
    }
}
Also used : ServerSession(org.apache.activemq.artemis.core.server.ServerSession) ConsumerView(org.apache.activemq.artemis.core.management.impl.view.ConsumerView) ServerConsumer(org.apache.activemq.artemis.core.server.ServerConsumer) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ConsumerView (org.apache.activemq.artemis.core.management.impl.view.ConsumerView)1 ServerConsumer (org.apache.activemq.artemis.core.server.ServerConsumer)1 ServerSession (org.apache.activemq.artemis.core.server.ServerSession)1