Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binding 'any' port w/o using the port inc method of hazelcast #9775

ykonrad opened this issue Jan 29, 2017 · 1 comment


None yet
2 participants
Copy link

commented Jan 29, 2017

"bind any" is a built-in java server socket factory java functionality. I would like to be able to set in the HZ configuration this option so I won't have to specify setPortAutoIncrement, and port count. I would like to be able to say 'bind any available' and let the jvm choose some random free port. Maybe jsut set port=0 in configuration...

This can be easily achieved by providing 0 (zero) as port to the serversocket.bind . Unfortunately , when trying to use setPort(0) with hz network config it is not working as expected. The instance will bind random port as required, but the "BindAddress" and "PublicAddress" will be populated with port=0, as in configuration. As result, the cluster members will not see each other. The most simple solution is to use the resolved port (taken from socket) rather of the configured port.

For a workaround, Please refer:!topic/hazelcast/KFNOAFpqdUg

This is a complicated solution. a much simple solution can be added into your code.

@mdogan mdogan added this to the 3.9 milestone Jan 30, 2017

@mdogan mdogan self-assigned this Feb 15, 2017


This comment has been minimized.

Copy link

commented Feb 16, 2017

Similar issue: #2506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.