Jolokia Monitoring
📊 Jolokia Monitoring & JMX Integration
📡 Overview
MAPS Messaging integrates with Jolokia, a JMX-over-HTTP bridge that allows you to monitor and interact with internal server metrics and Java Management Extensions (JMX) remotely. This is useful for debugging, live metric inspection, and integration with monitoring platforms like Prometheus, Grafana, or custom dashboards.
Jolokia configuration is defined in jolokia.yaml
.
⚙️ Basic Configuration
jolokia:
enable: false
config:
port: 8778
host: 0.0.0.0
backlog: 10
canonicalNaming: true
Field | Description |
---|---|
enable | Enables/disables Jolokia plugin. |
port | TCP port used by the Jolokia HTTP agent. |
host | Bind address (e.g., 0.0.0.0 for all interfaces). |
backlog | Max number of incoming connections to queue. |
canonicalNaming | Controls JMX object naming style. |
🧠 Advanced Monitoring Settings
historyMaxEntries: 10
maxDepth: 7
maxCollectionSize: 200
allowDnsReverseLookup: false
cors: false
Field | Description |
---|---|
historyMaxEntries | Number of metric history snapshots to keep. |
maxDepth | Recursion depth for complex object serialization. |
maxCollectionSize | Max size of arrays or collections returned via API. |
allowDnsReverseLookup | Whether to enable reverse DNS lookups. |
cors | Enable CORS access to the Jolokia endpoint. |
🐞 Debugging & Error Handling
debug: true
debugMaxEntries: 100
includeStackTrace: false
allowErrorDetails: false
serializeException: false
These fields control how much diagnostic information Jolokia will capture and expose.
⚠️ Set all debugging options to
false
in production to avoid sensitive data leakage.
🌍 Discovery Configuration
discoveryEnabled: false
multicastGroup: 239.192.48.48
multicastPort: 24884
Field | Description |
---|---|
discoveryEnabled | Enables auto-discovery via multicast |
multicastGroup | Multicast group for Jolokia discovery protocol |
multicastPort | Port used for multicast announcements |
🔐 SSL Configuration (Optional)
Jolokia supports optional SSL/TLS encryption:
# keystore: my-keystore.jks
# serverCert: serverCertName
# serverKey: serverKeyName
# sslProtocol: TLSv1.2
# keyStoreType: JKS
# keyManagerAlgorithm: SunX509
# trustManagerAlgorithm: SunX509
# useSslClientAuthentication: false
You can configure secure sockets by uncommenting and setting the appropriate key/trust store details.
🛡️ Consider enabling
sslProtocol
, certificate validation, and secure ciphers for external monitoring setups.
🚀 Example Use Case
Expose live heap memory usage and thread metrics to Prometheus or Grafana:
- Enable Jolokia on a secure port
- Integrate with a Prometheus JMX exporter
- Configure Grafana dashboards to pull metrics
✅ Best Practices
- Enable Jolokia only on secure/internal interfaces.
- Disable debugging and stack traces in production.
- Use HTTPS + authentication to restrict access.
- Integrate with observability tools via JMX bridges or exporters.
- Avoid excessive history/maxCollectionSize settings to preserve performance.