I want to do throttling for a consumer of some queue in activeMQ, in hornetq (from jboss, this is done with annotations according to the definition of the mdb user). I can not find anything like this in the activemq documentation, the closest I found is
consumer.recvDelay 0 ms Pause consumer for recvDelay milliseconds with each message (allows consumer throttling).
from: http://activemq.apache.org/activemq-performance-module-users-manual.html
But I can not find how I can do this in java.
Thanks in advance,
Sincerely.
EDIT: Here is the ActiveMQManager code and user code:
public class ActiveMQManager { private static ActiveMQConnectionFactory CONNECTION_FACTORY; public static Connection CONNECTION; public static Session SESSION; public static Destination TEST_QUEUE; public static void start() { try { CONNECTION_FACTORY = new ActiveMQConnectionFactory("vm://localhost"); CONNECTION = CONNECTION_FACTORY.createConnection(); CONNECTION.start(); SESSION = CONNECTION.createSession(false, Session.CLIENT_ACKNOWLEDGE); TestClient testClient = new TestClient(); TEST_QUEUE = SESSION.createQueue("TEST.QUEUE"); MessageConsumer testConsumer = SESSION.createConsumer(TEST_QUEUE); test.setMessageListener(testClient); } catch (Exception e) { } } public static void stop() { try {
}
The user code is very simple (for this example):
public class TestConsumer implements MessageListener { @Override public void onMessage(Message message) {
}
source share