Search code examples
spring-integrationjmxspring-jmx

how to export spring task:executor as mbean?


We are using task:executor in our spring integration application. We need to monitor this threadpool via mbean browser. So far we have good control over all spring integration channels , message handlers etc and those are showing in our mbean browser but we like to see task executor threadpool also be visible so we can see how many threads are in pool, how many being used etc

Is it possible to export them as mbean? if so how it can be done?


Solution

  • <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
        <property name="beans">
            <map>
                <entry key="exec:name=exec" value-ref="exec" />
            </map>
        </property>
    </bean>
    
    <task:executor id="exec" />