[wildfly-dev] WildFly Server IP Address and Port

Brian Stansberry brian.stansberry at redhat.com
Wed Sep 2 09:20:57 EDT 2015


On 9/1/15 6:52 PM, Arun Gupta wrote:
>>>> Is this scenario different from running multiple WildFly instances on a
>>>> single machine in a non-Docker setup?
>>>
>>>
>>> Good point, they are the same.
>>>
>>
>> Reading a bit more, it seems Docker gives each container its own address,
>> visible to the container via the eth0 interface:
>>
>> https://docs.docker.com/articles/networking/
>
> Those IP addresses are not available externally AIU.
>

Ok, I'm getting clear on your scenario. Thanks.

>>> So, if WildFly runs with -b <IP_ADDRESS> then the utility above will
>>> give the correct address and port?
>>>
>>
>> Yes, assuming IP_ADDRESS != 0.0.0.0, the server config is using a
>> socket-binding named "http" for the web server, and the web server
>> address/port is the one you want.
>>
>
>              ObjectName http = new
> ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=http");
>              hostName = (String) mBeanServer.getAttribute(http,"boundAddress");
>              hostPort = (Integer) mBeanServer.getAttribute(http,"boundPort");
>
>
> seems to be returning correct HTTP host/port. However
>
>              ObjectName https = new
> ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=https");
>              hostSecurePort = (int) mBeanServer.getAttribute(https, "boundPort");
>
> is throwing NPE.
>
> Will this only be available if HTTPS port is accessible?
>

Those attributes will only be non-null if the https socket-binding is 
used by some service (e.g. an undertow listener.) If the configuration 
doesn't require the socket binding to be used, then the resolution of 
the socket binding's config data to an actual IP address will not occur.

> Arun
>
>
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list