You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Sargrad, Dave" <Da...@saabinc.com> on 2023/08/30 15:05:15 UTC

FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Hi.
I've got an artemis broker running. I am able to browse to the admin portal at 8161. I also am able to publish and subscribe to 61616.

I want to control the broker programmatically.

I've searched for sample code to do this.

All I've found seems to be this JMX enabled sample.

https://github.com/apache/activemq-artemis/tree/main/examples/features/standard/client-kickoff

Can someone point me to a sample that does not use JMX? Is JMX the only way to control an artemis broker programmatically?

Assuming that the Broker always uses JMX for this type of programmatic control, do I need to configure this by adding the following attributes to the brokers JVM state?
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=3000
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Thanks in advance for your guidance.




This message is marked Public.
This e-mail (including attachments) contains contents owned by Saab Group AB and/or its subsidiaries, affiliated companies or customers and covered by the laws of Sweden, the US, or Canada (federal, state or provincial). The information is intended to be confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments.

Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by Clebert Suconic <cl...@gmail.com>.
You can also use the management API over messaging.   Take a look at a
class named SimpleManagement on the codebase in main.


I know how to do JMX and stuff but I find it easier to manage.

On Thu, Aug 31, 2023 at 9:46 AM Justin Bertram <jb...@apache.org> wrote:

> The default management.xml does indeed have the connector commented out
> which means there is no remote JMX connectivity. This is for security
> purposes so that it's less likely that someone deploys an unsecured broker
> with management wide open.
>
> Therefore, if you want to enable remote JMX connectivity you need to enable
> the connector.
>
>
> Justin
>
>
> On Thu, Aug 31, 2023 at 8:20 AM Sargrad, Dave <Da...@saabinc.com>
> wrote:
>
> > Looking at the referenced documentation, I see that the proper way to set
> > the JMX connection port is as follows:
> > <connector connector-port="1099"/>
> >
> > Our current management.xml does not specify this connector-port (it is
> > commented out).
> >    <!--<connector connector-port="1099"/>-->
> >
> > What is the default port? This is not jumping out at me in the referenced
> > documentation?
> >
> >
> >
> >
> > This message is marked Public.
> >
> > -----Original Message-----
> > From: Justin Bertram <jb...@apache.org>
> > Sent: Wednesday, August 30, 2023 12:50 PM
> > To: users@activemq.apache.org
> > Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org
> >
> > The "client-kickoff" example is using Java system properties to configure
> > remote JMX connectivity. However, that configuration method was replaced
> > awhile back with management.xml which you can see being used in the "jmx"
> > example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the
> > meantime, please refer to the "jmx" example as well as the documentation
> > [2] for details on how remote JMX connectivity should be configured.
> >
> > The management API is fundamentally based on JMX, but it is exposed in
> > several different ways as noted in the documentation [3]:
> >
> >  - HTTP via Jolokia. See the documentation [4] for more details.
> >  - Management messages. See the documentation [5] and the "management"
> > example for more details.
> >
> >
> > Justin
> >
> > [1] https://issues.apache.org/jira/browse/ARTEMIS-4409
> > [2]
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
> > [3]
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html
> > [4]
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
> > [5]
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api
> >
> > On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Dave.Sargrad@saabinc.com
> >
> > wrote:
> >
> > >
> > > Hi.
> > > I've got an artemis broker running. I am able to browse to the admin
> > > portal at 8161. I also am able to publish and subscribe to 61616.
> > >
> > > I want to control the broker programmatically.
> > >
> > > I've searched for sample code to do this.
> > >
> > > All I've found seems to be this JMX enabled sample.
> > >
> > >
> > > https://github.com/apache/activemq-artemis/tree/main/examples/features
> > > /standard/client-kickoff
> > >
> > > Can someone point me to a sample that does not use JMX? Is JMX the
> > > only way to control an artemis broker programmatically?
> > >
> > > Assuming that the Broker always uses JMX for this type of programmatic
> > > control, do I need to configure this by adding the following
> > > attributes to the brokers JVM state?
> > > -Dcom.sun.management.jmxremote
> > > -Dcom.sun.management.jmxremote.port=3000
> > > -Dcom.sun.management.jmxremote.ssl=false
> > > -Dcom.sun.management.jmxremote.authenticate=false
> > >
> > > Thanks in advance for your guidance.
> > >
> > >
> > >
> > >
> > > This message is marked Public.
> > > This e-mail (including attachments) contains contents owned by Saab
> > > Group AB and/or its subsidiaries, affiliated companies or customers
> > > and covered by the laws of Sweden, the US, or Canada (federal, state or
> > provincial).
> > > The information is intended to be confidential and may be legally
> > > privileged. If you are not the intended recipient, you are hereby
> > > notified that any retention, dissemination, distribution, interception
> > > or copying of this communication is strictly prohibited and may
> > > subject you to further legal action. Reply to the sender if you
> > > received this email by accident, and then delete the email and any
> > attachments.
> > >
> > >
> > This e-mail (including attachments) contains contents owned by Saab Group
> > AB and/or its subsidiaries, affiliated companies or customers and covered
> > by the laws of Sweden, the US, or Canada (federal, state or provincial).
> > The information is intended to be confidential and may be legally
> > privileged. If you are not the intended recipient, you are hereby
> notified
> > that any retention, dissemination, distribution, interception or copying
> of
> > this communication is strictly prohibited and may subject you to further
> > legal action. Reply to the sender if you received this email by accident,
> > and then delete the email and any attachments.
> >
>
-- 
Clebert Suconic

Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by Justin Bertram <jb...@apache.org>.
The default management.xml does indeed have the connector commented out
which means there is no remote JMX connectivity. This is for security
purposes so that it's less likely that someone deploys an unsecured broker
with management wide open.

Therefore, if you want to enable remote JMX connectivity you need to enable
the connector.


Justin


On Thu, Aug 31, 2023 at 8:20 AM Sargrad, Dave <Da...@saabinc.com>
wrote:

> Looking at the referenced documentation, I see that the proper way to set
> the JMX connection port is as follows:
> <connector connector-port="1099"/>
>
> Our current management.xml does not specify this connector-port (it is
> commented out).
>    <!--<connector connector-port="1099"/>-->
>
> What is the default port? This is not jumping out at me in the referenced
> documentation?
>
>
>
>
> This message is marked Public.
>
> -----Original Message-----
> From: Justin Bertram <jb...@apache.org>
> Sent: Wednesday, August 30, 2023 12:50 PM
> To: users@activemq.apache.org
> Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org
>
> The "client-kickoff" example is using Java system properties to configure
> remote JMX connectivity. However, that configuration method was replaced
> awhile back with management.xml which you can see being used in the "jmx"
> example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the
> meantime, please refer to the "jmx" example as well as the documentation
> [2] for details on how remote JMX connectivity should be configured.
>
> The management API is fundamentally based on JMX, but it is exposed in
> several different ways as noted in the documentation [3]:
>
>  - HTTP via Jolokia. See the documentation [4] for more details.
>  - Management messages. See the documentation [5] and the "management"
> example for more details.
>
>
> Justin
>
> [1] https://issues.apache.org/jira/browse/ARTEMIS-4409
> [2]
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
> [3]
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html
> [4]
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
> [5]
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api
>
> On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>
> wrote:
>
> >
> > Hi.
> > I've got an artemis broker running. I am able to browse to the admin
> > portal at 8161. I also am able to publish and subscribe to 61616.
> >
> > I want to control the broker programmatically.
> >
> > I've searched for sample code to do this.
> >
> > All I've found seems to be this JMX enabled sample.
> >
> >
> > https://github.com/apache/activemq-artemis/tree/main/examples/features
> > /standard/client-kickoff
> >
> > Can someone point me to a sample that does not use JMX? Is JMX the
> > only way to control an artemis broker programmatically?
> >
> > Assuming that the Broker always uses JMX for this type of programmatic
> > control, do I need to configure this by adding the following
> > attributes to the brokers JVM state?
> > -Dcom.sun.management.jmxremote
> > -Dcom.sun.management.jmxremote.port=3000
> > -Dcom.sun.management.jmxremote.ssl=false
> > -Dcom.sun.management.jmxremote.authenticate=false
> >
> > Thanks in advance for your guidance.
> >
> >
> >
> >
> > This message is marked Public.
> > This e-mail (including attachments) contains contents owned by Saab
> > Group AB and/or its subsidiaries, affiliated companies or customers
> > and covered by the laws of Sweden, the US, or Canada (federal, state or
> provincial).
> > The information is intended to be confidential and may be legally
> > privileged. If you are not the intended recipient, you are hereby
> > notified that any retention, dissemination, distribution, interception
> > or copying of this communication is strictly prohibited and may
> > subject you to further legal action. Reply to the sender if you
> > received this email by accident, and then delete the email and any
> attachments.
> >
> >
> This e-mail (including attachments) contains contents owned by Saab Group
> AB and/or its subsidiaries, affiliated companies or customers and covered
> by the laws of Sweden, the US, or Canada (federal, state or provincial).
> The information is intended to be confidential and may be legally
> privileged. If you are not the intended recipient, you are hereby notified
> that any retention, dissemination, distribution, interception or copying of
> this communication is strictly prohibited and may subject you to further
> legal action. Reply to the sender if you received this email by accident,
> and then delete the email and any attachments.
>

RE: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by "Sargrad, Dave" <Da...@saabinc.com>.
Looking at the referenced documentation, I see that the proper way to set the JMX connection port is as follows:
<connector connector-port="1099"/>

Our current management.xml does not specify this connector-port (it is commented out).
   <!--<connector connector-port="1099"/>-->

What is the default port? This is not jumping out at me in the referenced documentation?




This message is marked Public.

-----Original Message-----
From: Justin Bertram <jb...@apache.org>
Sent: Wednesday, August 30, 2023 12:50 PM
To: users@activemq.apache.org
Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

The "client-kickoff" example is using Java system properties to configure remote JMX connectivity. However, that configuration method was replaced awhile back with management.xml which you can see being used in the "jmx"
example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the meantime, please refer to the "jmx" example as well as the documentation [2] for details on how remote JMX connectivity should be configured.

The management API is fundamentally based on JMX, but it is exposed in several different ways as noted in the documentation [3]:

 - HTTP via Jolokia. See the documentation [4] for more details.
 - Management messages. See the documentation [5] and the "management"
example for more details.


Justin

[1] https://issues.apache.org/jira/browse/ARTEMIS-4409
[2]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
[3]
https://activemq.apache.org/components/artemis/documentation/latest/management.html
[4]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
[5]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api

On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>
wrote:

>
> Hi.
> I've got an artemis broker running. I am able to browse to the admin
> portal at 8161. I also am able to publish and subscribe to 61616.
>
> I want to control the broker programmatically.
>
> I've searched for sample code to do this.
>
> All I've found seems to be this JMX enabled sample.
>
>
> https://github.com/apache/activemq-artemis/tree/main/examples/features
> /standard/client-kickoff
>
> Can someone point me to a sample that does not use JMX? Is JMX the
> only way to control an artemis broker programmatically?
>
> Assuming that the Broker always uses JMX for this type of programmatic
> control, do I need to configure this by adding the following
> attributes to the brokers JVM state?
> -Dcom.sun.management.jmxremote
> -Dcom.sun.management.jmxremote.port=3000
> -Dcom.sun.management.jmxremote.ssl=false
> -Dcom.sun.management.jmxremote.authenticate=false
>
> Thanks in advance for your guidance.
>
>
>
>
> This message is marked Public.
> This e-mail (including attachments) contains contents owned by Saab
> Group AB and/or its subsidiaries, affiliated companies or customers
> and covered by the laws of Sweden, the US, or Canada (federal, state or provincial).
> The information is intended to be confidential and may be legally
> privileged. If you are not the intended recipient, you are hereby
> notified that any retention, dissemination, distribution, interception
> or copying of this communication is strictly prohibited and may
> subject you to further legal action. Reply to the sender if you
> received this email by accident, and then delete the email and any attachments.
>
>
This e-mail (including attachments) contains contents owned by Saab Group AB and/or its subsidiaries, affiliated companies or customers and covered by the laws of Sweden, the US, or Canada (federal, state or provincial). The information is intended to be confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments.

Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by Clebert Suconic <cl...@gmail.com>.
For 3: I added a class named SimpleMangement to the code base that can help
with management Over messaging

On Tue, Sep 12, 2023 at 1:00 PM Domenico Francesco Bruscino <
bruscinodf@gmail.com> wrote:

> Hi Dave,
>
> Question 1
> I'm not able to see the attached image, could you write the text?
>
> Question 2
> Justin already answered, The default management.xml does indeed have the
> connector commented out which means there is no remote JMX connectivity....
>
> Question 3
> Clebert already answered, You can also use the management API over
> messaging...
> Another way is to use the jolokia endpoint, i.e. curl -H "Origin:
> http://localhost:8161" -u admin:admin
>
> http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\
> "broker\"/Version
>
> Regards,
> Domenico
>
> On Mon, 11 Sept 2023 at 15:49, Sargrad, Dave <Da...@saabinc.com>
> wrote:
>
> > Hi.  Thanks for your fast turn-around on issue 4409.
> >
> > [ARTEMIS-4409] Update examples to use management.xml - ASF JIRA
> > (apache.org) <https://issues.apache.org/jira/browse/ARTEMIS-4409>
> >
> >
> >
> > I have 3 questions.
> >
> >
> >
> > *Question 1*
> >
> >
> >
> > I see that in the updated documentation the Artemis broker is specified
> as
> > follows:
> >
> >
> >
> > I have an Artemis broker running on my private network. I am trying to
> > figure out how to specify the hostname and port for the JMX interface.
> >
> >
> >
> > In line 59 above, I only see the hostname specified.  How do I specify
> the
> > JMX port to connect to?
> >
> >
> >
> > *Question 2*
> >
> >
> >
> > Also what is the default JMX port?
> >
> >
> >
> > *Question 3*
> >
> >
> >
> > Lastly is JMX the one and only way (the proper way) to control Artemis
> > programmatically? Or are there other options that I should understand
> > before building an application that controls the Artemis state?
> >
> >
> >
> > Please advise.
> >
> >
> >
> > -----Original Message-----
> > From: Justin Bertram <jb...@apache.org>
> > Sent: Wednesday, August 30, 2023 12:50 PM
> > To: users@activemq.apache.org
> > Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org
> >
> >
> >
> > The "client-kickoff" example is using Java system properties to configure
> > remote JMX connectivity. However, that configuration method was replaced
> > awhile back with management.xml which you can see being used in the "jmx"
> >
> > example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the
> > meantime, please refer to the "jmx" example as well as the documentation
> > [2] for details on how remote JMX connectivity should be configured.
> >
> >
> >
> > The management API is fundamentally based on JMX, but it is exposed in
> > several different ways as noted in the documentation [3]:
> >
> >
> >
> > - HTTP via Jolokia. See the documentation [4] for more details.
> >
> > - Management messages. See the documentation [5] and the "management"
> >
> > example for more details.
> >
> >
> >
> >
> >
> > Justin
> >
> >
> >
> > [1] https://issues.apache.org/jira/browse/ARTEMIS-4409
> >
> > [2]
> >
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
> >
> > [3]
> >
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html
> >
> > [4]
> >
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
> >
> > [5]
> >
> >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api
> >
> >
> >
> > On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Dave.Sargrad@saabinc.com
> >
> >
> > wrote:
> >
> >
> >
> > >
> >
> > > Hi.
> >
> > > I've got an artemis broker running. I am able to browse to the admin
> >
> > > portal at 8161. I also am able to publish and subscribe to 61616.
> >
> > >
> >
> > > I want to control the broker programmatically.
> >
> > >
> >
> > > I've searched for sample code to do this.
> >
> > >
> >
> > > All I've found seems to be this JMX enabled sample.
> >
> > >
> >
> > >
> >
> > > https://github.com/apache/activemq-artemis/tree/main/examples/features
> >
> > > /standard/client-kickoff
> >
> > >
> >
> > > Can someone point me to a sample that does not use JMX? Is JMX the
> >
> > > only way to control an artemis broker programmatically?
> >
> > >
> >
> > > Assuming that the Broker always uses JMX for this type of programmatic
> >
> > > control, do I need to configure this by adding the following
> >
> > > attributes to the brokers JVM state?
> >
> > > -Dcom.sun.management.jmxremote
> >
> > > -Dcom.sun.management.jmxremote.port=3000
> >
> > > -Dcom.sun.management.jmxremote.ssl=false
> >
> > > -Dcom.sun.management.jmxremote.authenticate=false
> >
> > >
> >
> > > Thanks in advance for your guidance.
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > This message is marked Public.
> >
> > > This e-mail (including attachments) contains contents owned by Saab
> >
> > > Group AB and/or its subsidiaries, affiliated companies or customers
> >
> > > and covered by the laws of Sweden, the US, or Canada (federal, state or
> > provincial).
> >
> > > The information is intended to be confidential and may be legally
> >
> > > privileged. If you are not the intended recipient, you are hereby
> >
> > > notified that any retention, dissemination, distribution, interception
> >
> > > or copying of this communication is strictly prohibited and may
> >
> > > subject you to further legal action. Reply to the sender if you
> >
> > > received this email by accident, and then delete the email and any
> > attachments.
> >
> > >
> >
> > >
> >
> >
> >
> > This message is marked Public.
> > This e-mail (including attachments) contains contents owned by Saab Group
> > AB and/or its subsidiaries, affiliated companies or customers and covered
> > by the laws of Sweden, the US, or Canada (federal, state or provincial).
> > The information is intended to be confidential and may be legally
> > privileged. If you are not the intended recipient, you are hereby
> notified
> > that any retention, dissemination, distribution, interception or copying
> of
> > this communication is strictly prohibited and may subject you to further
> > legal action. Reply to the sender if you received this email by accident,
> > and then delete the email and any attachments.
> >
>
-- 
Clebert Suconic

Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by Domenico Francesco Bruscino <br...@gmail.com>.
Hi Dave,

Question 1
I'm not able to see the attached image, could you write the text?

Question 2
Justin already answered, The default management.xml does indeed have the
connector commented out which means there is no remote JMX connectivity....

Question 3
Clebert already answered, You can also use the management API over
messaging...
Another way is to use the jolokia endpoint, i.e. curl -H "Origin:
http://localhost:8161" -u admin:admin
http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\
"broker\"/Version

Regards,
Domenico

On Mon, 11 Sept 2023 at 15:49, Sargrad, Dave <Da...@saabinc.com>
wrote:

> Hi.  Thanks for your fast turn-around on issue 4409.
>
> [ARTEMIS-4409] Update examples to use management.xml - ASF JIRA
> (apache.org) <https://issues.apache.org/jira/browse/ARTEMIS-4409>
>
>
>
> I have 3 questions.
>
>
>
> *Question 1*
>
>
>
> I see that in the updated documentation the Artemis broker is specified as
> follows:
>
>
>
> I have an Artemis broker running on my private network. I am trying to
> figure out how to specify the hostname and port for the JMX interface.
>
>
>
> In line 59 above, I only see the hostname specified.  How do I specify the
> JMX port to connect to?
>
>
>
> *Question 2*
>
>
>
> Also what is the default JMX port?
>
>
>
> *Question 3*
>
>
>
> Lastly is JMX the one and only way (the proper way) to control Artemis
> programmatically? Or are there other options that I should understand
> before building an application that controls the Artemis state?
>
>
>
> Please advise.
>
>
>
> -----Original Message-----
> From: Justin Bertram <jb...@apache.org>
> Sent: Wednesday, August 30, 2023 12:50 PM
> To: users@activemq.apache.org
> Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org
>
>
>
> The "client-kickoff" example is using Java system properties to configure
> remote JMX connectivity. However, that configuration method was replaced
> awhile back with management.xml which you can see being used in the "jmx"
>
> example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the
> meantime, please refer to the "jmx" example as well as the documentation
> [2] for details on how remote JMX connectivity should be configured.
>
>
>
> The management API is fundamentally based on JMX, but it is exposed in
> several different ways as noted in the documentation [3]:
>
>
>
> - HTTP via Jolokia. See the documentation [4] for more details.
>
> - Management messages. See the documentation [5] and the "management"
>
> example for more details.
>
>
>
>
>
> Justin
>
>
>
> [1] https://issues.apache.org/jira/browse/ARTEMIS-4409
>
> [2]
>
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
>
> [3]
>
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html
>
> [4]
>
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
>
> [5]
>
>
> https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api
>
>
>
> On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>
>
> wrote:
>
>
>
> >
>
> > Hi.
>
> > I've got an artemis broker running. I am able to browse to the admin
>
> > portal at 8161. I also am able to publish and subscribe to 61616.
>
> >
>
> > I want to control the broker programmatically.
>
> >
>
> > I've searched for sample code to do this.
>
> >
>
> > All I've found seems to be this JMX enabled sample.
>
> >
>
> >
>
> > https://github.com/apache/activemq-artemis/tree/main/examples/features
>
> > /standard/client-kickoff
>
> >
>
> > Can someone point me to a sample that does not use JMX? Is JMX the
>
> > only way to control an artemis broker programmatically?
>
> >
>
> > Assuming that the Broker always uses JMX for this type of programmatic
>
> > control, do I need to configure this by adding the following
>
> > attributes to the brokers JVM state?
>
> > -Dcom.sun.management.jmxremote
>
> > -Dcom.sun.management.jmxremote.port=3000
>
> > -Dcom.sun.management.jmxremote.ssl=false
>
> > -Dcom.sun.management.jmxremote.authenticate=false
>
> >
>
> > Thanks in advance for your guidance.
>
> >
>
> >
>
> >
>
> >
>
> > This message is marked Public.
>
> > This e-mail (including attachments) contains contents owned by Saab
>
> > Group AB and/or its subsidiaries, affiliated companies or customers
>
> > and covered by the laws of Sweden, the US, or Canada (federal, state or
> provincial).
>
> > The information is intended to be confidential and may be legally
>
> > privileged. If you are not the intended recipient, you are hereby
>
> > notified that any retention, dissemination, distribution, interception
>
> > or copying of this communication is strictly prohibited and may
>
> > subject you to further legal action. Reply to the sender if you
>
> > received this email by accident, and then delete the email and any
> attachments.
>
> >
>
> >
>
>
>
> This message is marked Public.
> This e-mail (including attachments) contains contents owned by Saab Group
> AB and/or its subsidiaries, affiliated companies or customers and covered
> by the laws of Sweden, the US, or Canada (federal, state or provincial).
> The information is intended to be confidential and may be legally
> privileged. If you are not the intended recipient, you are hereby notified
> that any retention, dissemination, distribution, interception or copying of
> this communication is strictly prohibited and may subject you to further
> legal action. Reply to the sender if you received this email by accident,
> and then delete the email and any attachments.
>

RE: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by "Sargrad, Dave" <Da...@saabinc.com>.
Hi.  Thanks for your fast turn-around on issue 4409.

[ARTEMIS-4409] Update examples to use management.xml - ASF JIRA (apache.org)<https://issues.apache.org/jira/browse/ARTEMIS-4409>



I have 3 questions.



Question 1



I see that in the updated documentation the Artemis broker is specified as follows:

[cid:image001.png@01D9E493.45915C60]



I have an Artemis broker running on my private network. I am trying to figure out how to specify the hostname and port for the JMX interface.



In line 59 above, I only see the hostname specified.  How do I specify the JMX port to connect to?



Question 2



Also what is the default JMX port?



Question 3



Lastly is JMX the one and only way (the proper way) to control Artemis programmatically? Or are there other options that I should understand before building an application that controls the Artemis state?



Please advise.



-----Original Message-----
From: Justin Bertram <jb...@apache.org>
Sent: Wednesday, August 30, 2023 12:50 PM
To: users@activemq.apache.org
Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org



The "client-kickoff" example is using Java system properties to configure remote JMX connectivity. However, that configuration method was replaced awhile back with management.xml which you can see being used in the "jmx"

example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the meantime, please refer to the "jmx" example as well as the documentation [2] for details on how remote JMX connectivity should be configured.



The management API is fundamentally based on JMX, but it is exposed in several different ways as noted in the documentation [3]:



- HTTP via Jolokia. See the documentation [4] for more details.

- Management messages. See the documentation [5] and the "management"

example for more details.





Justin



[1] https://issues.apache.org/jira/browse/ARTEMIS-4409

[2]

https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access

[3]

https://activemq.apache.org/components/artemis/documentation/latest/management.html

[4]

https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia

[5]

https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api



On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>>

wrote:



>

> Hi.

> I've got an artemis broker running. I am able to browse to the admin

> portal at 8161. I also am able to publish and subscribe to 61616.

>

> I want to control the broker programmatically.

>

> I've searched for sample code to do this.

>

> All I've found seems to be this JMX enabled sample.

>

>

> https://github.com/apache/activemq-artemis/tree/main/examples/features

> /standard/client-kickoff

>

> Can someone point me to a sample that does not use JMX? Is JMX the

> only way to control an artemis broker programmatically?

>

> Assuming that the Broker always uses JMX for this type of programmatic

> control, do I need to configure this by adding the following

> attributes to the brokers JVM state?

> -Dcom.sun.management.jmxremote

> -Dcom.sun.management.jmxremote.port=3000

> -Dcom.sun.management.jmxremote.ssl=false

> -Dcom.sun.management.jmxremote.authenticate=false

>

> Thanks in advance for your guidance.

>

>

>

>

> This message is marked Public.

> This e-mail (including attachments) contains contents owned by Saab

> Group AB and/or its subsidiaries, affiliated companies or customers

> and covered by the laws of Sweden, the US, or Canada (federal, state or provincial).

> The information is intended to be confidential and may be legally

> privileged. If you are not the intended recipient, you are hereby

> notified that any retention, dissemination, distribution, interception

> or copying of this communication is strictly prohibited and may

> subject you to further legal action. Reply to the sender if you

> received this email by accident, and then delete the email and any attachments.

>

>


This message is marked Public.

This e-mail (including attachments) contains contents owned by Saab Group AB and/or its subsidiaries, affiliated companies or customers and covered by the laws of Sweden, the US, or Canada (federal, state or provincial). The information is intended to be confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments.

RE: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by "Sargrad, Dave" <Da...@saabinc.com>.
Thanks for your lightning fast response!! I'll take a look and see if I can make progress with your guidance.


This message is marked Public.

-----Original Message-----
From: Justin Bertram <jb...@apache.org>
Sent: Wednesday, August 30, 2023 12:50 PM
To: users@activemq.apache.org
Subject: Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

The "client-kickoff" example is using Java system properties to configure remote JMX connectivity. However, that configuration method was replaced awhile back with management.xml which you can see being used in the "jmx"
example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the meantime, please refer to the "jmx" example as well as the documentation [2] for details on how remote JMX connectivity should be configured.

The management API is fundamentally based on JMX, but it is exposed in several different ways as noted in the documentation [3]:

 - HTTP via Jolokia. See the documentation [4] for more details.
 - Management messages. See the documentation [5] and the "management"
example for more details.


Justin

[1] https://issues.apache.org/jira/browse/ARTEMIS-4409
[2]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
[3]
https://activemq.apache.org/components/artemis/documentation/latest/management.html
[4]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
[5]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api

On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>
wrote:

>
> Hi.
> I've got an artemis broker running. I am able to browse to the admin
> portal at 8161. I also am able to publish and subscribe to 61616.
>
> I want to control the broker programmatically.
>
> I've searched for sample code to do this.
>
> All I've found seems to be this JMX enabled sample.
>
>
> https://github.com/apache/activemq-artemis/tree/main/examples/features
> /standard/client-kickoff
>
> Can someone point me to a sample that does not use JMX? Is JMX the
> only way to control an artemis broker programmatically?
>
> Assuming that the Broker always uses JMX for this type of programmatic
> control, do I need to configure this by adding the following
> attributes to the brokers JVM state?
> -Dcom.sun.management.jmxremote
> -Dcom.sun.management.jmxremote.port=3000
> -Dcom.sun.management.jmxremote.ssl=false
> -Dcom.sun.management.jmxremote.authenticate=false
>
> Thanks in advance for your guidance.
>
>
>
>
> This message is marked Public.
> This e-mail (including attachments) contains contents owned by Saab
> Group AB and/or its subsidiaries, affiliated companies or customers
> and covered by the laws of Sweden, the US, or Canada (federal, state or provincial).
> The information is intended to be confidential and may be legally
> privileged. If you are not the intended recipient, you are hereby
> notified that any retention, dissemination, distribution, interception
> or copying of this communication is strictly prohibited and may
> subject you to further legal action. Reply to the sender if you
> received this email by accident, and then delete the email and any attachments.
>
>
This e-mail (including attachments) contains contents owned by Saab Group AB and/or its subsidiaries, affiliated companies or customers and covered by the laws of Sweden, the US, or Canada (federal, state or provincial). The information is intended to be confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, interception or copying of this communication is strictly prohibited and may subject you to further legal action. Reply to the sender if you received this email by accident, and then delete the email and any attachments.

Re: FW: {EXTERNAL MAIL} WELCOME to users@activemq.apache.org

Posted by Justin Bertram <jb...@apache.org>.
The "client-kickoff" example is using Java system properties to configure
remote JMX connectivity. However, that configuration method was replaced
awhile back with management.xml which you can see being used in the "jmx"
example. I've opened ARTEMIS-4409 [1] and sent a PR to fix this. In the
meantime, please refer to the "jmx" example as well as the documentation
[2] for details on how remote JMX connectivity should be configured.

The management API is fundamentally based on JMX, but it is exposed in
several different ways as noted in the documentation [3]:

 - HTTP via Jolokia. See the documentation [4] for more details.
 - Management messages. See the documentation [5] and the "management"
example for more details.


Justin

[1] https://issues.apache.org/jira/browse/ARTEMIS-4409
[2]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#remote-jmx-access
[3]
https://activemq.apache.org/components/artemis/documentation/latest/management.html
[4]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#exposing-jmx-using-jolokia
[5]
https://activemq.apache.org/components/artemis/documentation/latest/management.html#using-management-message-api

On Wed, Aug 30, 2023 at 10:07 AM Sargrad, Dave <Da...@saabinc.com>
wrote:

>
> Hi.
> I've got an artemis broker running. I am able to browse to the admin
> portal at 8161. I also am able to publish and subscribe to 61616.
>
> I want to control the broker programmatically.
>
> I've searched for sample code to do this.
>
> All I've found seems to be this JMX enabled sample.
>
>
> https://github.com/apache/activemq-artemis/tree/main/examples/features/standard/client-kickoff
>
> Can someone point me to a sample that does not use JMX? Is JMX the only
> way to control an artemis broker programmatically?
>
> Assuming that the Broker always uses JMX for this type of programmatic
> control, do I need to configure this by adding the following attributes to
> the brokers JVM state?
> -Dcom.sun.management.jmxremote
> -Dcom.sun.management.jmxremote.port=3000
> -Dcom.sun.management.jmxremote.ssl=false
> -Dcom.sun.management.jmxremote.authenticate=false
>
> Thanks in advance for your guidance.
>
>
>
>
> This message is marked Public.
> This e-mail (including attachments) contains contents owned by Saab Group
> AB and/or its subsidiaries, affiliated companies or customers and covered
> by the laws of Sweden, the US, or Canada (federal, state or provincial).
> The information is intended to be confidential and may be legally
> privileged. If you are not the intended recipient, you are hereby notified
> that any retention, dissemination, distribution, interception or copying of
> this communication is strictly prohibited and may subject you to further
> legal action. Reply to the sender if you received this email by accident,
> and then delete the email and any attachments.
>
>