[jboss-user] [Management, JMX/JBoss] - StopDelivery() in JBoss works with 1 message delay

matrixpooh do-not-reply at jboss.com
Mon Feb 11 13:17:06 EST 2008


Hi,

I'm trying to programmatically stop delivery of messages in MDB deployed on Jboss 4.0.2. The call to JMSContanerInvoker::stopDelivery() works with a delay. For ex: if there are 4 messages in the queue and I issue stopDelivery() after consuming the very first message, the MDB would still consume the second message and stop only then leaving remaining 2 messages in the queue.
 
I saw a similar behavior in Jboss's JMX Console, where in order to stop delivery immediately one has to first click 'Invoke' in stopDelivery() section then navigate back and click 'Apply Changes' in a 'List of MBean Attributes' section.

Your help in resolving '1 message delay' in a call to stopDelivery() would be greatly appreciated.

--
AN

Here's the test class:

  | import java.util.Hashtable;
  | import java.util.List;
  | 
  | import javax.management.ObjectInstance;
  | import javax.management.ObjectName;
  | 
  | import junit.framework.Assert;
  | 
  | import org.apache.log4j.Logger;
  | import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
  | 
  | public class JmxManagerForMdbTest extends AbstractTest {
  | 
  | 	private static final Logger log = Logger.getLogger(QueueListenerTest.class);
  | 
  | 	public void test() throws Exception{
  | 		
  | 		RMIAdaptor server = (RMIAdaptor) super.initialContext.lookup("jmx/rmi/RMIAdaptor");
  | 
  | 
  | 		Hashtable<String, String> ht = new Hashtable<String, String>();
  | 		ht.put("binding", "message-driven-bean");
  | 		ht.put("jndiName", "queue.listener");
  | 		ht.put("plugin", "invoker");
  | 		ht.put("service", "EJB");
  | 		ObjectName name = new ObjectName("jboss.j2ee", ht);
  | 
  | 		
  | 		server.invoke(name, "stopDelivery", new Object[] {}, null);
  | 
  | 	}
  | 
  | 	@Override
  | 	public List<? extends AbstractTest> getProcessQueueTests() {
  | 		return null;
  | 	}
  | 
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128451#4128451

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128451



More information about the jboss-user mailing list