Comments (6)
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.
How about optional dependency?
from rabbitmq-java-client.
If the dependency is optional then the feature is also opt-in. This may be a decent middle ground.
from rabbitmq-java-client.
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.
@augi yes, that sounds reasonable.
from rabbitmq-java-client.
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)
- Rabbitmq Consumers Stops consuming
- Make RpcClient (Auto)Closeable HOT 1
- Do not confirmSelect more than once per channel HOT 1
- Add ability to specify maximum message size HOT 8
- Bump dependencies
- IndexOutOfBoundsException when calling ConnectionFactory.newConnection() HOT 4
- close method of the AMQConnection class HOT 1
- Channels that have had exceptions but not explicitly closed can be recovered via connection recovery HOT 3
- Bump dependencies
- Add a "builder" (chained setters) API to the ConnectionFactory class HOT 2
- amqp-client-5.19.0 has a required OSGi dependency on micrometer HOT 3
- Bump dependencies
- Memory leak in RpcClient HOT 2
- Occasional leak of Thread/Channel instances and threads blocking indefinately HOT 6
- Too large message causes infinite loop / consumer can no longer consume messages HOT 2
- Thread Pinning occurs with VirtualThreads enabled (spring boot 3) HOT 2
- Handshake error when connecting to AWS NLB using TLS 1.2 and NIO HOT 2
- Bump dependencies
- Invalid value check in NioParams.setWriteByteBufferSize HOT 1
- An interface for filtering out entities (e.g. queues) from the topology recovery cache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rabbitmq-java-client.