[jboss-user] [Messaging, JMS & JBossMQ] - Re: import org.jboss.mq.server.jmx.Queue

milind.uc do-not-reply at jboss.com
Tue Mar 27 06:09:13 EDT 2007


yes ,, hay thanks for ur reply as I get confident from your reply  because before reading your reply I  did the things  which  you mentioned but the thing is that only the getQueueDepth is working   which is nothing but the tolal number fo the messages in the queue..Other attributes like the getSchedulemessagecount(),getReceiversCount() are  giving the values zero ..Still writing this reply I used  all thses things only on the receivers side.. I did in the foloowing way  while sending the messages and still  not on the receivers side...


  | MBeanServerConnection  mbean_server  =  null;
  | 			ObjectName dm  = null;
  | try{
  | 	    		
  | 	   	
  | 		  mbean_server =(MBeanServerConnection) ctx.lookup("jmx/rmi/RMIAdaptor");
  | 	      dm   = new ObjectName("jboss.mq:service=DestinationManager");
  | 
  | String domain = "jboss.mq.destination";
  | 	       String service = "service=Queue";
  | 		   String name = "name=queue/C";
  | 				
  | 			String stringObjectName = domain + ":" + service + "," + name;
  | 				
  | 
  | 
  | 
  | 				ObjectName queueObjectName = ObjectName.getInstance(stringObjectName);
  | 				
  | 				org.jboss.mq.server.jmx.QueueMBean queueMBean = 
  | 					(org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance(
  | 							mbean_server,
  | 							queueObjectName,
  | 							org.jboss.mq.server.jmx.QueueMBean.class,
  | 							false
  | 						);
  | 				System.out.println("queue depth is :" + queueMBean.getQueueDepth());
  | 				System.out.println("getScheduledMessageCount count is :" + queueMBean.getScheduledMessageCount());
  | 				System.out.println("History Limit :"+queueMBean.getMessageCounterHistoryDayLimit());
  | 				System.out.println("MAximmum depth :"+ queueMBean.getMaxDepth());
  | 				System.out.println("Receiver Count is :" +queueMBean.getReceiversCount());
  | 				System.out.println("Redelivery Limit:"+queueMBean.getRedeliveryLimit());
  | 				System.out.println("Name is :"+queueMBean.getName());
  | 				System.out.println("queue name is :"+queueMBean.getQueueName());
  | 
  | 
  | 

Again if I did the   org.jboss.mq.server MessageCounter meas []= queueMBean.getMessageCounter(); then  I got the exception as===
java.lang.reflect.UndeclaredThrowableException
	at $Proxy1.getMessageCounter(Unknown Source)
	at Statstic.Sender_Count.main(Sender_Count.java:220)
Caused by: java.io.NotSerializableException: org.jboss.mq.server.MessageCounter
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224)
.....

Beside the total  count of the messages in the queue I also needed how many   messages are scheduled(Recived  by reciver ) ,pending.If u have idea then please suggest and guide me.

Thanks for all your help it is pleasurabel :)
	      

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

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



More information about the jboss-user mailing list