Stephan Birkl created AMQ-8629:
----------------------------------

             Summary: MessageGroupHashBucket MBean returns data type not 
deserializable by jmx/visualvm
                 Key: AMQ-8629
                 URL: https://issues.apache.org/jira/browse/AMQ-8629
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.16.5, 5.17.1, 5.18.0
            Reporter: Stephan Birkl
         Attachments: MessageGroupHashBucket.patch

We've switched our queues to MessageGroupHashBucket MessageGroupMap strategy.

One thing we've noticed is that when looking at the queues mbean in visualvm, 
it now shows correctly "bucket" in the MessageGroupType attribute, but the 
"MessageGroups" attribute is "unavailable" and when hovering the following 
exception is shown:

java.rmi.UnmarshalException: ... ClassNotFoundException: 
org.apache.activemq.memory.LRUMap

So basically visualvm cannot deserialize LRUMap, which of course makes sense. 
MBeans should not return app specific classes.

To reproduce it, you can configure the following policy entry:
{noformat}
                <policyEntry 
                    queue=">">
                    <messageGroupMapFactory>
                        <messageGroupHashBucketFactory/>
                    </messageGroupMapFactory>
                </policyEntry>{noformat}
I've checked the implementation of MessageGroupHashBucket.java and compared it 
to the default implementation CachedMessageGroupMap.java.

CachedMessageGroupMap also maintains a LRUMap but converts it in method 
getGroups() to a HashMap. getGroups() seems only to be used for the MBean as 
far as I can see.

Therefore I wrote a small patch to basically take over the implementation from 
CachedMessageGroupMap.java to MessageGroupHashBucket.java. Please find the 
patch attached.

I've successfully compiled and tested it locally. The MBean attribute is now 
correctly displayed and also from functionality point of view I did not see any 
negative side effect.

Is there any chance to get this patch reviewed and added to 5.16.x, which we 
currently use in production?



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to