Skip to content

Commit 2adc4ce

Browse files
Document discontinued JMX support.
1 parent 4dfe895 commit 2adc4ce

File tree

3 files changed

+6
-63
lines changed

3 files changed

+6
-63
lines changed
-48.1 KB
Binary file not shown.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,8 @@ static class Config extends AbstractMongoClientConfiguration {
5757
----
5858

5959
Users upgrading from prior versions may choose `BigDecimalRepresentation.STRING` as default to retain previous behaviour.
60+
61+
== JMX Support Discontinued.
62+
63+
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

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,6 @@
33

44
[NOTE]
55
====
6-
JMX support has been deprecated in 4.5 and will be removed in 5.0. +
6+
JMX support has been removed in 5.0. +
77
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.
88
====
9-
10-
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.
11-
12-
[[mongodb:jmx-configuration]]
13-
== MongoDB JMX Configuration
14-
15-
Spring's Mongo namespace lets you enable JMX functionality, as the following example shows:
16-
17-
.XML schema to configure MongoDB
18-
====
19-
[source,xml]
20-
----
21-
<?xml version="1.0" encoding="UTF-8"?>
22-
<beans xmlns="http://www.springframework.org/schema/beans"
23-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24-
xmlns:context="http://www.springframework.org/schema/context"
25-
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
26-
xsi:schemaLocation="
27-
http://www.springframework.org/schema/context
28-
https://www.springframework.org/schema/context/spring-context-3.0.xsd
29-
http://www.springframework.org/schema/data/mongo
30-
https://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
31-
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
32-
33-
<!-- Default bean name is 'mongo' -->
34-
<mongo:mongo-client host="localhost" port="27017"/>
35-
36-
<!-- by default look for a Mongo object named 'mongo' -->
37-
<mongo:jmx/>
38-
39-
<context:mbean-export/>
40-
41-
<!-- To translate any MongoExceptions thrown in @Repository annotated classes -->
42-
<context:annotation-config/>
43-
44-
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean" p:port="1099" />
45-
46-
<!-- Expose JMX over RMI -->
47-
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"
48-
depends-on="registry"
49-
p:objectName="connector:name=rmi"
50-
p:serviceUrl="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/myconnector" />
51-
52-
</beans>
53-
----
54-
====
55-
56-
The preceding code exposes several MBeans:
57-
58-
* `AssertMetrics`
59-
* `BackgroundFlushingMetrics`
60-
* `BtreeIndexCounters`
61-
* `ConnectionMetrics`
62-
* `GlobalLockMetrics`
63-
* `MemoryMetrics`
64-
* `OperationCounters`
65-
* `ServerInfo`
66-
* `MongoAdmin`
67-
68-
The following screenshot from JConsole shows the resulting configuration:
69-
70-
image::jconsole.png[]

0 commit comments

Comments
 (0)