Bug 703314 - as4 plugin: message-driven beans are discovered as stateless session beans
Summary: as4 plugin: message-driven beans are discovered as stateless session beans
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: jon3
TreeView+ depends on / blocked
 
Reported: 2011-05-09 23:51 UTC by Ian Springer
Modified: 2024-03-04 13:35 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Ian Springer 2011-05-09 23:51:47 UTC
An easy example of this is AlertConditionConsumerBean, which is an MDB deployed to the RHQ Server JBoss AS instance. This MDB gets discovered with ResourceType "EJB3 Session Bean". Instead, it should either be discovered as a separate "EJB3 Message-Driven Bean" ResourceType, or it should not be discovered at all. 

Another sign something is wrong with the AlertConditionConsumerBean Resource is that all of its metrics (Create Count, Remove Count, etc.) fail to collect - their values are "N/A" if you go to the Monitoring>Tables subtab.

Comment 1 Ian Springer 2011-05-10 02:21:10 UTC
I peeked at jmx-console and it looks like the ObjectNames of MBeans for SLSBs and MDBs both look exactly the same. Here's an example:

ear=rhq.ear,jar=rhq-enterprise-server-ejb3.jar,name=FooBean,service=EJB3

In other words, you cannot tell an SLSB MBean from an MDB MBean just from the MBean names.

Fortunately, they can be distinguished by looking at their attributes. SLSBs have the following attributes:

Name 	java.lang.String 	R 	StatelessDelegateWrapper 	MBean Attribute.
StateString 	java.lang.String 	R 	Started 	MBean Attribute.
CreateCount 	int 	R 	8 	MBean Attribute.
State 	int 	R 	3 	MBean Attribute.
InvokeStats 	org.jboss.ejb3.statistics.InvocationStatistics 	R 		MBean Attribute.
CurrentSize 	int 	R 	5 	MBean Attribute.
RemoveCount 	int 	R 	3 	MBean Attribute.
MaxSize 	int 	R 	30 	MBean Attribute.
AvailableCount 	int 	R 	30 	MBean Attribute.

while MDBs have the following attributes:

Name 	java.lang.String 	R 	MdbDelegateWrapper 	MBean Attribute.
KeepAliveMillis 	int 	R 	60000 	MBean Attribute.
StateString 	java.lang.String 	R 	Started 	MBean Attribute.
State 	int 	R 	3 	MBean Attribute.
InvokeStats 	org.jboss.ejb3.statistics.InvocationStatistics 	R 		MBean Attribute.
MinPoolSize 	int 	R 	1 	MBean Attribute.
MaxPoolSize 	int 	R 	15 	MBean Attribute.
MaxMessages 	int 	R 	1 	MBean Attribute.

So they could be told apart using:

if (nameAttributeValue.equals("MdbDelegateWrapper")) {
   // MDB
} else {
   // SLSB or SFSB
}

We currently only have one ResourceType for EJB3 beans - "EJB3 Session Bean", which represents both stateless and stateful session beans. So we'll need a new "EJB3 Message-Driven Bean" ResourceType, which would have a different set of metrics that the session bean restype to correspond to the MDB MBean attributes above.


Note You need to log in before you can comment on or make changes to this bug.