[
https://issues.apache.org/jira/browse/CAMEL-8880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
stephen hartley updated CAMEL-8880:
-----------------------------------
Description:
It would be very helpful to me if the Camel API (Spring and Java) had the
ability to expose the JMX service either using the host name or using IP
address. At present release no option is given and the host name is always used.
This would mean a change to the logic in
{{org.apache.camel.management.DefaultManagementAgent}} for determining JMX
hostname in {code}protected void createMBeanServer(){code} method:
{code}
if (canAccessSystemProps) {
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException uhe) {
LOG.info("Cannot determine localhost name. Using default: " +
DEFAULT_REGISTRY_PORT, uhe);
hostName = DEFAULT_HOST;
}
} else {
hostName = DEFAULT_HOST;
}{code}
If the API passed down a request to use the IP then
{{InetAddress.getLocalHost().getHostAddress()}} should be called rather than
{{InetAddress.getLocalHost().getHostName()}}.
The reason for wanting this is that my host has an underscore {{_}} character
in its name. A {{java.net.MalformedURLException: Bad URL path:}} exception is
(correctly) thrown by {{javax.management.remote.JMXServiceURL}} when the looked
up name is used to form the URL for the JMX service.
I know this is not a valid host name according to the various RFCs, but I have
been unable to convince network administrators to change the host name. If I
used the IP instead then validation would pass and the JMX service would be
correctly exposed.
I would find it very helpful if the Camel API could expose an option to use JMX
with host IP address as well as for the host name.
I would like to be able to configure something like this:
{code:xml}<jmxAgent id="camelJmxAgent" createConnector="true"
registryPort="{{jmx.registry.port:1099}}" useIpAddress="true" />{code}
Thanks!
was:
It would be very helpful to me if the camel API (Spring and Java) could allow
to expose the JMX service either using the host name or using IP address.
This would mean a change to `DefaultManagementAgent`'s logic for determining
hostname in createMBeanServer method:
if (canAccessSystemProps) {
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException uhe) {
LOG.info("Cannot determine localhost name. Using default: " +
DEFAULT_REGISTRY_PORT, uhe);
hostName = DEFAULT_HOST;
}
} else {
hostName = DEFAULT_HOST;
}
If the API passed down a request to use the IP then
InetAddress.getLocalHost().getHostAddress() should be called rather than
getHostName().
The reason for wanting this is that my host has an underscore _ character in
its name. A java.net.MalformedURLException: Bad URL path: exception is
(correctly) thrown by javax.management.remote.JMXServiceURL when the looked up
name is used to form the URL for the JMX service. I know this is not a valid
host name according to the various RFCs, but I have been unable to convince
network administrators to change the host name. If I used the IP instead then
validation would pass and the JMX service would be correctly exposed.
I would find it very helpful if the Camel API could expose an option to use JMX
with host IP address as well as for the host name.
I would like to be able to configure something like this:
<jmxAgent id="camelJmxAgent" createConnector="true"
registryPort="{{jmx.registry.port:1099}}"
useIpAddress="true" />
Thanks!
> Enable ability to expose Camel JMX service using IP address API
> ---------------------------------------------------------------
>
> Key: CAMEL-8880
> URL: https://issues.apache.org/jira/browse/CAMEL-8880
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Affects Versions: 2.15.2
> Reporter: stephen hartley
> Fix For: 2.15.3
>
>
> It would be very helpful to me if the Camel API (Spring and Java) had the
> ability to expose the JMX service either using the host name or using IP
> address. At present release no option is given and the host name is always
> used.
> This would mean a change to the logic in
> {{org.apache.camel.management.DefaultManagementAgent}} for determining JMX
> hostname in {code}protected void createMBeanServer(){code} method:
> {code}
> if (canAccessSystemProps) {
> try {
> hostName = InetAddress.getLocalHost().getHostName();
> } catch (UnknownHostException uhe) {
> LOG.info("Cannot determine localhost name. Using default: " +
> DEFAULT_REGISTRY_PORT, uhe);
> hostName = DEFAULT_HOST;
> }
> } else {
> hostName = DEFAULT_HOST;
> }{code}
> If the API passed down a request to use the IP then
> {{InetAddress.getLocalHost().getHostAddress()}} should be called rather than
> {{InetAddress.getLocalHost().getHostName()}}.
> The reason for wanting this is that my host has an underscore {{_}} character
> in its name. A {{java.net.MalformedURLException: Bad URL path:}} exception
> is (correctly) thrown by {{javax.management.remote.JMXServiceURL}} when the
> looked up name is used to form the URL for the JMX service.
> I know this is not a valid host name according to the various RFCs, but I
> have been unable to convince network administrators to change the host name.
> If I used the IP instead then validation would pass and the JMX service would
> be correctly exposed.
> I would find it very helpful if the Camel API could expose an option to use
> JMX with host IP address as well as for the host name.
> I would like to be able to configure something like this:
> {code:xml}<jmxAgent id="camelJmxAgent" createConnector="true"
> registryPort="{{jmx.registry.port:1099}}" useIpAddress="true" />{code}
> Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)