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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -