Giter Site home page Giter Site logo

Comments (6)

michaelklishin avatar michaelklishin commented on September 8, 2024

This is a good idea but there's one problem: this means we'd have an external dependency on something like the Metrics library. Historically the client has been trying hard to stay dependency-free as much as possible.

Besides that, what specific metrics do you want to collect? Number of threads used by the library is not necessarily easy to calculate because custom thread executors and factories can be provided.

Per protocol method stats (number of messages published, delivered, acked, nacked, fetched with basic.get) sounds good.

from rabbitmq-java-client.

stevecstian avatar stevecstian commented on September 8, 2024

How about optional dependency?

from rabbitmq-java-client.

michaelklishin avatar michaelklishin commented on September 8, 2024

If the dependency is optional then the feature is also opt-in. This may be a decent middle ground.

from rabbitmq-java-client.

augi avatar augi commented on September 8, 2024

I don't have deep understanding of the Client internals so I picked few metrics that could be interesting (mainly number of messages).

If we don't want to add more dependencies to Client then we could introduce a plain interface for metrics, support it in ConnectionFactory, and call it from the right places. The implementation could be in separate project then.

Optional dependency could be also viable solution.

from rabbitmq-java-client.

michaelklishin avatar michaelklishin commented on September 8, 2024

@augi yes, that sounds reasonable.

from rabbitmq-java-client.

MartinGoodwell avatar MartinGoodwell commented on September 8, 2024

Is there any progress on JMX integration?
I wanted to add that for pure JMX metrics, no additional dependency is required as any functionality is available in the javax.management package.
Here's an example (where BrokerMetrics is a POJO that implements an interface called BrokerMetricsMBean:

import java.lang.management.ManagementFactory;

import javax.management.InstanceAlreadyExistsException;
import javax.management.MBeanRegistrationException;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
import javax.management.ObjectName;

//Get the MBean server
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
//register the MBean
BrokerMetrics mBean = new BrokerMetrics();
ObjectName name = new ObjectName("com.rabbitmq:type=Broker");
mbs.registerMBean(mBean, name);

Here's a more verbose example (with quite some annoying ads): http://www.journaldev.com/1352/what-is-jmx-mbean-jconsole-tutorial

I tried to do the implementation myself but I already failed at building the rabbitmq-java-client (error in antrun)

from rabbitmq-java-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.