Browse Source

Document discontinued JMX support.

See #5078
Original pull request #5080
pull/5109/head
Christoph Strobl 1 month ago committed by Jens Schauder
parent
commit
0df237189e
No known key found for this signature in database
GPG Key ID: 2BE5D185CD2A1CE6
  1. BIN
      src/main/antora/modules/ROOT/assets/images/jconsole.png
  2. 5
      src/main/antora/modules/ROOT/pages/migration-guide/migration-guide-4.x-to-5.x.adoc
  3. 64
      src/main/antora/modules/ROOT/pages/mongodb/jmx.adoc

BIN
src/main/antora/modules/ROOT/assets/images/jconsole.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

5
src/main/antora/modules/ROOT/pages/migration-guide/migration-guide-4.x-to-5.x.adoc

@ -57,3 +57,8 @@ static class Config extends AbstractMongoClientConfiguration { @@ -57,3 +57,8 @@ static class Config extends AbstractMongoClientConfiguration {
----
Users upgrading from prior versions may choose `BigDecimalRepresentation.STRING` as default to retain previous behaviour.
== JMX Support Discontinued.
We recommend switching to Spring Boot https://docs.spring.io/spring-boot/reference/actuator/endpoints.html[Actuator Endpoints].

64
src/main/antora/modules/ROOT/pages/mongodb/jmx.adoc

@ -3,68 +3,6 @@ @@ -3,68 +3,6 @@
[NOTE]
====
JMX support has been deprecated in 4.5 and will be removed in 5.0. +
JMX support has been removed in 5.0. +
We recommend switching to Spring Boot https://docs.spring.io/spring-boot/reference/actuator/endpoints.html[Actuator Endpoints] and expose those over JMX if needed.
====
The JMX support for MongoDB exposes the results of running the 'serverStatus' command on the admin database for a single MongoDB server instance. It also exposes an administrative MBean, `MongoAdmin`, that lets you perform administrative operations, such as dropping or creating a database. The JMX features build upon the JMX feature set available in the Spring Framework. See link:{springDocsUrl}/integration.html#jmx[here] for more details.
[[mongodb:jmx-configuration]]
== MongoDB JMX Configuration
Spring's Mongo namespace lets you enable JMX functionality, as the following example shows:
.XML schema to configure MongoDB
====
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="
http://www.springframework.org/schema/context
https://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/mongo
https://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Default bean name is 'mongo' -->
<mongo:mongo-client host="localhost" port="27017"/>
<!-- by default look for a Mongo object named 'mongo' -->
<mongo:jmx/>
<context:mbean-export/>
<!-- To translate any MongoExceptions thrown in @Repository annotated classes -->
<context:annotation-config/>
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean" p:port="1099" />
<!-- Expose JMX over RMI -->
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"
depends-on="registry"
p:objectName="connector:name=rmi"
p:serviceUrl="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/myconnector" />
</beans>
----
====
The preceding code exposes several MBeans:
* `AssertMetrics`
* `BackgroundFlushingMetrics`
* `BtreeIndexCounters`
* `ConnectionMetrics`
* `GlobalLockMetrics`
* `MemoryMetrics`
* `OperationCounters`
* `ServerInfo`
* `MongoAdmin`
The following screenshot from JConsole shows the resulting configuration:
image::jconsole.png[]

Loading…
Cancel
Save