Wednesday, May 27, 2015

Case study of where certain JMX Mbean values are saved in Alfresco

Let's do a case study of two property value that can be overridden via alfreco-global.properties; synchronization.syncOnStartup and index.subsystem.name.  I was  particularly interested in these two properties because alfresco was not honoring the values I put in the alfresco-global.properties file.  That normally points to one of two things:  that another property file is overriding the value or that the properties are being overridden via JMX MBeans.  NOTE: I did this case study on Alfresco 4.1.1.27.

Using JConsole and navigating to the MBeans tab, I verified the location that alfresco documentation had pointed me to.  Note: Yes, I agree it's confusing that property values do not always match up with their MBean names.



  • synchronization.syncOnStartup:  Alfresco > Configuration > Search > manager > attributes > sourceBeanName













  • index.subsystem.name: Alfresco > Configuration  Synchronization > default > attributes > synchronization.syncOnStartup














  • The values were indeed different than what my alfresco-global.properties files were configured to.  To fix that, navigate to "Operations", you'll notice start|stop|revert operations available.  To have alfresco honor the values in your properties file, you will need to "revert" the value.  You can hit "revert" once and see the value that is replaced in the MBean.  You may need to hit "revert" numerous times, as as many times as the property may have been "set" previously.

    The Alfresco JMX MBean values are stored in the Alfresco database.  There are three tables that these values are stored in:

    • alf_prop_string_value: table where the MBean property is saved
    • alf_prop_root and alf_prop_unique_ctx: this will tell alfresco to honor the property file value or not
    Viewing all data in the alf_prop_string_value table, you can see the two MBean properties that we set.  You can tell that the sourceBeanName MBean got set twice (row 9 is the MBean, row 10 is first time it was set, row 11 is second time it was set), and that the synchronization.syncOnStartup got set once (row 13 is the MBean, row 14 is when it was set).














    This query locates the two MBean values that I know I manipulated, and shows the latest value it was set to:

    select r.id, sk.string_value, sv.string_value 
    from alf_prop_root r, alf_prop_link l, alf_prop_value k, alf_prop_value v, alf_prop_string_value sk, alf_prop_string_value sv 
    where 
    r.id = l.root_prop_id 
    and l.key_prop_id=k.id 
    and l.value_prop_id=v.id 
    and k.long_value=sk.id 
    and v.long_value=sv.id;


























    Several additional interesting things to note when I spoke with Alfresco on this topic:
    • It's not certain that all JMX MBeans work the same way, or are stored in the same tables.  
    • There's no easy way to tell if there are any JMX overridden values in the system.  You can use the queries above to see if you find the MBean that you interested in and see if it is stored in the same fashion.  
    • In a clustered environment, Alfresco MBean values are applied to all nodes in the cluster.  In other words, you cannot use an MBean to configured node 1 and node 2 differently.
    • The log4j MBeans are not stored in the database.  Any changes to log4j MBeans only persist until the alfresco server is restarted.  In other words, the log4j or custom-log4j properties will be honored as soon as alfresco is restarted.

    No comments:

    Post a Comment

    I appreciate your time in leaving a comment!