spring-jmx

Spring framework monitoring ThreadPoolTaskExecutor queue size

青春壹個敷衍的年華 提交于 2021-02-07 14:01:07
问题 I checked http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.html There is no getter for queue size, only queue capacity. If I use jmx to monnitor ThreadPoolTaskExecutor, how can I monitor queue size level to make sure it is healthy? 回答1: executor.getThreadPoolExecutor().getQueue().size() EDIT @ManagedResource public class MyTEMBean { private final ThreadPoolTaskExecutor te; public MyTEMBean(ThreadPoolTaskExecutor

JMX and REST API. How can I build a bridge between them?

北城余情 提交于 2020-02-06 15:14:47
问题 I have written a code which exposes data from my JVM application via JMX Bean. I can see these values in JConsole. How can I grab these values from jconsole, do I need to write another program. And also, how can I use REST API to display these JMX Bean data to Rich UI format? I have used Jolokia and I am getting this reply. I am not getting any info. I used the jolokia as JVM argument in my code. But the only reply I am getting is this { timestamp: 1411988073, status: 200, request: { type:

Name for @ManagedOperation in Spring JMX

懵懂的女人 提交于 2020-02-01 05:31:11
问题 I used org.springframework.jmx.export.annotation.@ManagedOperation to expose a method as MBean. I want the operation name different from the method name, but managed operation doesn't have any attribute for it. For example: @ManagedOperation public synchronized void clearCache() { // do something } and I want this operation exposed with name = "ResetCache". 回答1: Create a custom annotation: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface JmxName { String value

spring boot actuator connect jmx programmatically

血红的双手。 提交于 2019-12-23 02:01:52
问题 I'd like to use the shutdown endpoint of my Spring Boot 2.0.1 application from the command line. For that I have only added the spring-boot-starter-actuator to my Gradle file and enabled the shutdown endpoint in the configuration. I also created a very simple tool that tries to connect via JMX to the running application. Snippet: String url = "service:jmx:rmi:///jndi/rmi://127.0.01:<which port?>/jmxrmi"; JMXServiceURL serviceUrl = new JMXServiceURL(url); JMXConnectorFactory.connect(serviceUrl

How to integrate JMX with Spring?

偶尔善良 提交于 2019-12-22 10:35:03
问题 I have simple class about JMX: Interface HelloMBean: public interface HelloMBean { public void sayHello(); public String getName(); public void setName(String name); public String conCat(String s1, String s2); } Class Hello implements from interface HelloMBean: import javax.management.AttributeChangeNotification; import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; public class Hello extends NotificationBroadcasterSupport implements HelloMBean {

Replacing @managed operation from xml itself in spring

巧了我就是萌 提交于 2019-12-13 04:38:54
问题 I am using JMX of spring Version 2.5 in which I am using JMX as shown below.. @ManagedOperation(description = "Mark the Entry corresponding ABC flow") @ManagedOperationParameters(value = { @ManagedOperationParameter(name = "def", description = "Ids of the entries that needs to be STOP"), @ManagedOperationParameter(name = "Comments", description = "Note on why these entries are being marked as stop") }) public void abcstop(String def, String gtr){ StringBuffer gfhtrPresent= jmxService.abcd(Ids

Exposing class attributes to JMX for Mule custom router: what are my options?

假如想象 提交于 2019-12-10 23:24:40
问题 Using Mule Enterprise Standalone 3.1.2 I'm instrumenting attributes of the org.mule.routing.UntilSuccessful via a subclass. My subclass is used as a custom router. <flow name="Queue Handler" processingStrategy="synchronous"> <inbound-endpoint ref="Some.Queue"> <vm:transaction action="ALWAYS_BEGIN"/> </inbound-endpoint> <custom-router class="com.company.product.mule.UntilSuccessfulSubclass"> <flow-ref name="SomeFlow" /> <spring:property name="objectStore" ref="SomeObjectStore" /> <spring

Spring ManagedAttribute appears in the Operations tab of the JMX console

百般思念 提交于 2019-12-10 22:55:13
问题 My MBeans are annotated using Spring annotations as follows: @ManagedAttribute(description = "returns the name") public String getName() { return name; } Now, whenever I open a JMX Console (be it VisualVM or JConsole), I can see the attributes of my beans in the Attributes tab, but I can also see the getName() method exposed in the Operations tab. Is there a way in which I can only see the attribute in the Attribute tab (i.e. hide it from the Operations tab)? 回答1:

spring boot actuator connect jmx programmatically

随声附和 提交于 2019-12-06 14:40:13
I'd like to use the shutdown endpoint of my Spring Boot 2.0.1 application from the command line. For that I have only added the spring-boot-starter-actuator to my Gradle file and enabled the shutdown endpoint in the configuration. I also created a very simple tool that tries to connect via JMX to the running application. Snippet: String url = "service:jmx:rmi:///jndi/rmi://127.0.01:<which port?>/jmxrmi"; JMXServiceURL serviceUrl = new JMXServiceURL(url); JMXConnectorFactory.connect(serviceUrl, null); <-- KAPOW! JMX is working because I can use jconsole to connect locally. I just have no clue

How to integrate JMX with Spring?

眉间皱痕 提交于 2019-12-06 02:01:45
I have simple class about JMX: Interface HelloMBean: public interface HelloMBean { public void sayHello(); public String getName(); public void setName(String name); public String conCat(String s1, String s2); } Class Hello implements from interface HelloMBean: import javax.management.AttributeChangeNotification; import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; public class Hello extends NotificationBroadcasterSupport implements HelloMBean { private String m_name; @Override public void sayHello() { System.out.print("I say hello"); } @Override public