java - How to set ActiveMQ to stop accepting messages? -
i want know in activemq there property user can restrict activemq not accept messages in input queue after threshold reached ? far able find out flow control using memory constraint. want dynamically block input queue when input queue reaches threshold. there other software can me achieve goal ?
possible way plug custom broker interceptor activemq.
supple spring broker configuration with:
<plugins> <bean id="myplugin" class="org.foo.checkthresholdplugin"/> </plugins>
then extend brokerplugin override send method.
package org.foo; import org.apache.activemq.broker.broker; import org.apache.activemq.broker.brokerplugin; public class checkthresholdplugin extends brokerfilter { public void send(producerbrokerexchange producer, message message) throws exception { boolean isoverthreshold = /* figure out getting destination message */ if (isoverthreshold) { throw new exception("the threshold exceeded."); } else { super.send(producer, message); } } }
Comments
Post a Comment