See: Description
Class | Description |
---|---|
ClientProvider | |
ServerProvider |
JMX Remote provider for ActiveMQ.
Various URL query parameters control the behaviour of the the
JMS Connection; which are described in the table below. Each of these
properties can also be provided in the initial set of attributes that
is passed in JMXConnectorServerFactory#newJMXConnectorServer
or JMXConnectorFactory#newJMXConnector()
. All keys are case sensitive,
and if specified in the URL will be stripped before being passed to
ActiveMQConnectionFactory
Attribute/Parameter | Description |
---|---|
jmx.type |
The destination type (i.e. Topic or Queue ;
case-sensitive); defaults to Topic.
|
jmx.destination |
The name of a Topic or Queue; if not assigned, then a unique one will be created to avoid exceptions; this is, though, pointless from a usability perspective |
jmx.brokerUser |
The username to connect to the broker (if required); defaults to null. This may be a redundant; as you can often configure the username directly on the URL |
jmx.brokerPassword |
The password to connect to the broker (if required); defaults to null. This is likely to be redundant; as you can often configure the password directly on the URL. |
jmx.timeout |
The timeout in milliseconds for a client to wait for a reply after sending a request; defaults to 60000. |
jmx.clientid |
The client ID to be associated with the underlying ActiveMQConnectionFactory if desired. This is likely to be redundant; as you can often configure the clientid directly on
the URL anyway. |
You can mix and match the environment with the URL, the URL will
take precedence, apart from in the case where JMXConnector.CREDENTIALS
exists in the
initial set of attributes, that will always replace the brokerUser and
brokerPassword.
Or if you want to have things in the initial environment, then you could have something like
JMXServiceURL url = new JMXServiceURL("service:jmx:activemq:///tcp://localhost:61616?jmx.destination=jmxQueue"); Map env = new HashMap(); env.put(JmsJmxConnectionFactory.ATTR_DESTINATION_TYPE, "Queue"); env.put(JmsJmxConnectionFactory.ATTR_BROKER_USERNAME, "MyUserName"); env.put(JmsJmxConnectionFactory.ATTR_BROKER_PASSWORD, "MyPassword"); JMXConnector jmxClient = JMXConnectorFactory.newJMXConnector(url, env); jmxClient.connect();
Note that if you are using ActiveMQ 5.12 and above then you will need to set the org.apache.activemq.SERIALIZABLE_PACKAGES
system property to enable notifications to be sent via ActiveMQ as object message serialization needs to be explicitly enabled. Check
the documentation for the specifics of the property.