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

Optional random ports for Embedded Cassandra #119

Merged
merged 12 commits into from
May 8, 2015
Merged

Optional random ports for Embedded Cassandra #119

merged 12 commits into from
May 8, 2015

Conversation

MarkusKull
Copy link
Contributor

Our Jenkins may start multiple jobs containing an embedded cassandra in parallel. This leads to build errors due to duplicate ports.

This pull request reads the yaml before starting cassandra and replaces ports with value 0 by a random free port. Getters for port, host, cluster have been added to EmbeddedCassandraServerHelper, while configuration for these now unneeded values has been removed from the EmbeddedCassandra-Annotation.

The default yaml still contains the well known ports, so existing projects should continue to work. To use the random ports a new optional yaml has been added, which must be explicitly configured.

…often fails because embedded cassandra uses

fixed ports and thus cannot be started in parallel. This patch allows to set a "0"-port in the configuration,
which is automatically replaced by any (random) free port.
The chosen port can be read by EmbeddedCassandraServerHelper#getNativeTransportPort. For convenience a predefined
configuration is also provided as an option.
…ssandraServerHelper (if not explicitly configured)
…ssandraServerHelper (if not explicitly configured)
get rid of the now useless hostport-constructors
…assandra can be started before springcontext
@jsevellec
Copy link
Owner

Hi Markus, thanks for this contribution as well.

a real good proposal. I will have a deeper look asap

jsevellec added a commit that referenced this pull request May 8, 2015
Optional random ports for Embedded Cassandra
@jsevellec jsevellec merged commit d43797a into jsevellec:master May 8, 2015
@jsevellec
Copy link
Owner

I've just published a 2.1.3.2-SNAPSHOT containing the PR
(https://oss.sonatype.org/content/repositories/snapshots/)

@augi
Copy link

augi commented Jun 19, 2015

This is exactly what we are looking for, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants