Skip to content

Commit 444d5da

Browse files
authored
NO-JIRA add another curl management example
1 parent eaef1b2 commit 444d5da

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/user-manual/management.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,14 @@ See the xref:examples.adoc#jmx-management[JMX Management Example] which shows ho
475475
The default Broker configuration ships with the https://jolokia.org[Jolokia] HTTP agent deployed as a web application.
476476
Jolokia is a remote JMX-over-HTTP bridge that exposes MBeans.
477477
For a full guide as to how to use it refer to https://jolokia.org/documentation.html[Jolokia Documentation], however a simple example to query the broker's version would be to use a `curl` command like this:
478-
478+
[,console]
479+
----
480+
$ curl -v -H "Origin: http://localhost" -u myUser:myPass http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\"/Active
481+
----
482+
Or you could send a JSON formatted request instead of using the URL
483+
[,console]
479484
----
480-
curl -v -H "Origin: http://localhost" -u myUser:myPass http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\"/Active
485+
$ curl -v -H "Origin: http://localhost" -u myUser:myPass --header "Content-type: application/json" --request POST --data '{"attribute": "Active", "mbean": "org.apache.activemq.artemis:broker=\"0.0.0.0\"", "type": "read"}' http://localhost:8161/console/jolokia
481486
----
482487

483488
By default it's necessary to pass the `Origin` header due to the CORS checking which is configured in `etc/jolokia-access.xml`.

0 commit comments

Comments
 (0)