I have been using the JMX reporter to gather data from a running flink instance, more specifically to access a Gauge in one of my functions.
I am able to access this metric through:
JMXClientListener listener = new JMXClientListener();
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
...
JmxGaugeMBean mbeanProxy = JMX.newMBeanProxy(mbsc, name, JmxGaugeMBean.class, true);
System.out.println(((Collection<?>) mbeanProxy.getValue()).size());
---
This works as expected, giving the relevant output for this metric, every time it runs.
Since JMX supports the use of notifications, I was wondering if flink metrics are able to support this, a simple trial of:
mbsc.addNotificationListener(name, listener, null, null);
failed with:
java.lang.IllegalArgumentException:
The specified MBean [bean info] is not a NotificationBroadcaster object.
which leads me to believe that Gauge metrics do not support this interface.
As it would be very beneficial for my program to use a push-based system such as these notifications, as opposed to a pull-based approach (such as the one in the code shown above), I would like the first make sure whether flink supports JMX notifications or not, and if it does not to get insight into the best approach for solving this issue, for example by extending the JMX reporter in flink.
Thank you in advance for any insight provided into the matter,
--
Konstantinos Barmpis | Research Associate
White Rose Grid Enterprise Systems Group
Dept. of Computer Science
University of York
Tel: +44 (0) 1904-32 5653
Email Disclaimer: