So, the Broker is simply using the Java mechanism... and the Java mechanism is (I presume) just obeying the settings in your operating system. Which operating system are you seeing the broker pick "low" ports on, and how is that operating system configured with respect to the "dynamic" port range[1]? What sort of "low" numbers are you getting... which operating system are you seeing this on... and does the port number you are seeing lay outside the OS settings for dynamic port assignment?
-- Rob [1] According to this ( http://stackoverflow.com/questions/913501/how-to-let-kernel-choose-a-port-number-in-the-range-1024-5000-in-tcp-socket-pr) StackOverflow question, the following commands can be used to get the operating system settings: Linux: cat /proc/sys/net/ipv4/ip_local_port_range Windows: netsh int ipv4 show dynamicport tcp OS X: sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last Solaris: /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port On 14 March 2017 at 16:56, Adel Boutros <[email protected]> wrote: > Hello, > > > We are asked to deploy broker on random ports. So we thought about using > Port 0 and let the Broker find available ports. > > This works as expected however we have a concern with the port range. > > > It seems by default Java will take any port outside the well known ports > and assign it. However, in large environments, services are requested to > use private/dynamic ports (range 49152 to 65535 as specified by the > Internet Assigned Numbers Authority). > > > So I was wondering if there was a way to make the broker respect this port > range when it is passed a port value of 0? > > > Maybe allow the user to pass a property defining the range of ports > available. > > > What do you think? > > > Regards, > > Adel >
