Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup a JMX Notification Listener?
    text
    copied!<p>This is a follow-up of <a href="https://stackoverflow.com/questions/5792016/how-to-stop-message-processing-before-undeploying">How to stop message processing before undeploying?</a></p> <p>I want to configure a JMX Notification Listener for undeployment events, but I don't know how to set the mbean name correctly. We are currently using JBoss 4.2.3. The following attempt won't trigger any notification.</p> <pre><code>&lt;mbean code="jboss.example.NotificationListener" name="jboss.example:name=NotificationListener"&gt; &lt;attribute name="SubscriptionList"&gt; &lt;subscription-list&gt; &lt;mbean name="jboss.j2ee:service=EjbModule,type=jmx.attribute.change"&gt; &lt;/mbean&gt; &lt;notification type="JBOSS_MONITOR_NOTIFICATION"&gt;&lt;/notification&gt; &lt;/subscription-list&gt; &lt;/attribute&gt; &lt;/mbean&gt; </code></pre> <p>Here is a list of all notification events, which pop up on undeployment:</p> <pre><code>2011-05-05 09:06:09,020 INFO [org.jboss.ejb.EJBDeployer] Undeploying: file:/home/.../projects/jboss-server/local/server/dorun/tmp/deploy/tmp2721970726140354007mdb-simple.ear-contents/simple-mdb-ejb-1.0.0-SNAPSHOT.jar 2011-05-05 09:06:09,022 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EjbModule,module=simple-mdb-ejb-1.0.0-SNAPSHOT.jar][type=jmx.attribute.change][message=EjbModule stopping], handback: null 2011-05-05 09:06:10,032 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:jndiName=local/SimpleMessageEJB@30208588,service=EJB][type=jmx.attribute.change][message=MessageDrivenContainer stopping], handback: null 2011-05-05 09:06:11,050 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EJB,plugin=invoker,binding=message-driven-bean,jndiName=local/SimpleMessageEJB@30208588][type=jmx.attribute.change][message=JMSContainerInvoker stopping], handback: null 2011-05-05 09:06:12,061 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.j2ee:service=EJB,plugin=invoker,binding=message-driven-bean,jndiName=local/SimpleMessageEJB@30208588][type=org.jboss.ejb.plugins.jms.DISCONNECTING][message=], handback: null 2011-05-05 09:06:13,110 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.j2ee:service=EJB,plugin=invoker,binding=message-driven-bean,jndiName=local/SimpleMessageEJB@30208588][type=org.jboss.ejb.plugins.jms.DISCONNECTED][message=], handback: null 2011-05-05 09:06:14,119 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EJB,plugin=invoker,binding=message-driven-bean,jndiName=local/SimpleMessageEJB@30208588][type=jmx.attribute.change][message=JMSContainerInvoker stopped], handback: null 2011-05-05 09:06:15,128 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.system:service=ServiceController][type=org.jboss.system.ServiceMBean.stop][message=], handback: null 2011-05-05 09:06:16,138 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EJB,plugin=pool,jndiName=local/SimpleMessageEJB@30208588][type=jmx.attribute.change][message=MessageDrivenInstancePool stopping], handback: null 2011-05-05 09:06:17,148 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EJB,plugin=pool,jndiName=local/SimpleMessageEJB@30208588][type=jmx.attribute.change][message=MessageDrivenInstancePool stopped], handback: null 2011-05-05 09:06:18,157 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.system:service=ServiceController][type=org.jboss.system.ServiceMBean.stop][message=], handback: null 2011-05-05 09:06:19,166 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:jndiName=local/SimpleMessageEJB@30208588,service=EJB][type=jmx.attribute.change][message=MessageDrivenContainer stopped], handback: null 2011-05-05 09:06:20,175 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.system:service=ServiceController][type=org.jboss.system.ServiceMBean.stop][message=], handback: null 2011-05-05 09:06:21,184 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EjbModule,module=simple-mdb-ejb-1.0.0-SNAPSHOT.jar][type=jmx.attribute.change][message=EjbModule stopped], handback: null 2011-05-05 09:06:22,193 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.system:service=ServiceController][type=org.jboss.system.ServiceMBean.stop][message=], handback: null 2011-05-05 09:06:23,202 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.ejb:service=EJBDeployer][type=org.jboss.deployment.SubDeployer.stop][message=], handback: null 2011-05-05 09:06:24,211 INFO [org.jboss.deployment.ClientDeployer] Removing client ENC from: SimpleMessageClient 2011-05-05 09:06:24,212 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.j2ee:service=ClientDeployer][type=org.jboss.deployment.SubDeployer.stop][message=], handback: null 2011-05-05 09:06:25,221 INFO [STDOUT] Got notification: javax.management.Notification[source=jboss.management.local:ServiceModule=simple-mdb-sar-1.0.0-SNAPSHOT.sar,name=jboss.example%3aname%3dNotificationListener,J2EEServer=Local,J2EEApplication=null,j2eeType=MBean][type=j2ee.state.stopping][message=State changed], handback: null 2011-05-05 09:06:26,229 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.example:name=NotificationListener][type=jmx.attribute.change][message=NotificationListener stopping], handback: null 2011-05-05 09:06:27,236 INFO [STDOUT] Stop NotificationListener. </code></pre> <p>I thought it would be best to catch the very first event, so I want to catch:</p> <pre><code>2011-05-05 09:06:09,022 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EjbModule,module=simple-mdb-ejb-1.0.0-SNAPSHOT.jar][type=jmx.attribute.change][message=EjbModule stopping], handback: null </code></pre> <p>Any suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload