Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3183

<int-jmx:mbean-export /> Document ID for Programmatic Reference

    XMLWordPrintable

    Details

      Description

      The default namingStrategy IntegrationMBeanExporter results in a random, ambiguous JMX object name each time the application is started.

      E.g. <int-jmx:mbean-export /> results in org.springframework.integration.monitor:name=org.springframework.integration.monitor.IntegrationMBeanExporter#0#4be82f4d-4654-4adf-8e70-f4866137ac2b,type=IntegrationMBeanExporter

      This is random each time the app is deployed, it is not possible to reference this object by name/type from any control or monitor script, or even within the app itself. (e.g. create a shutdownChannel with int-jmx:operation-invoking-channel-adapter calling stopActiveComponents on IntegrationMBeanExporter)

      Workaround is to define the bean with namingStrategy set to IdentityNamingStrategy:

      <bean id="integrationMBeanExporter" class="org.springframework.integration.monitor.IntegrationMBeanExporter">
              <property name="namingStrategy">
                  <bean class="org.springframework.jmx.export.naming.IdentityNamingStrategy"/>
              </property>
          </bean>
      

      One would expect this or any non-random naming strategy as default, e.g. objectName=org.springframework.integration.monitor:name=integrationMBeanExporter,type=IntegrationMBeanExporter

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            sibidiba sibidiba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: