Bug 703314 - as4 plugin: message-driven beans are discovered as stateless session beans
as4 plugin: message-driven beans are discovered as stateless session beans
Status: NEW
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.0.0
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks: jon3
  Show dependency treegraph
 
Reported: 2011-05-09 19:51 EDT by Ian Springer
Modified: 2015-02-01 18:29 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Springer 2011-05-09 19:51:47 EDT
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-09 22:21:10 EDT
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.