diff options
author | Enrico Olivelli <eolivelli@apache.org> | 2020-11-18 18:18:12 +0000 |
---|---|---|
committer | Damien Diederen <ddiederen@apache.org> | 2020-11-18 18:18:12 +0000 |
commit | 12b4e6821997534e1ff58e2e29b9df0beab817d3 (patch) | |
tree | 5bcd9e36dbb45d3536bc7e9c9e6e106609cb2cf9 /pom.xml | |
parent | 300d7e9575496d10c92e7f0edca2bbc3746cb08d (diff) | |
download | zookeeper-12b4e6821997534e1ff58e2e29b9df0beab817d3.tar.gz |
ZOOKEEPER-3874: Official API to start ZooKeeper server from Java
Create an Official API to start a ZooKeeper server node from Java code.
The idea is not to run ZooKeeper server inside the same process of an application, but only to have a standard Launcher that can be used from Java and not a bash script.
See more context here
https://issues.apache.org/jira/browse/ZOOKEEPER-3874
This is how a Java launcher will look like for tests:
```
int clientPort = PortAssignment.unique();
final Properties configZookeeper = new Properties();
configZookeeper.put("clientPort", clientPort + "");
configZookeeper.put("host", "localhost");
configZookeeper.put("..........................");
try (ZooKeeperServerEmbedded zkServer = ZooKeeperServerEmbedded
.builder()
.baseDir(baseDir)
.configuration(configZookeeper)
.exitHandler(ExitHandler.LOG_ONLY)
.build()) {
zkServer.start();
//// wait.....
}
```
This feature does not overlap with Curator TestingServer, this feature is meant to be used a fundation for projects like TestingServer but also to run ZooKeeper server nodes in production.
This code is running in production at https://www.mag-news.com and https://emailsuccess.com, in such products we are using a Java based process manager
Author: Enrico Olivelli <eolivelli@apache.org>
Author: Enrico Olivelli <eolivelli@gmail.com>
Reviewers: Damien Diederen <ddiederen@apache.org>
Closes #1526 from eolivelli/fix/ZOOKEEPER-3874-embedded-api
Diffstat (limited to 'pom.xml')
-rwxr-xr-x | pom.xml | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -425,6 +425,7 @@ <surefire.version>2.22.1</surefire.version> <surefire-forkcount>8</surefire-forkcount> + <redirectTestOutputToFile>true</redirectTestOutputToFile> <!-- dependency versions --> <slf4j.version>1.7.30</slf4j.version> @@ -702,6 +703,10 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <trimStackTrace>false</trimStackTrace> + <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -961,6 +966,7 @@ <exclude>src/main/resources/markdown/skin/*</exclude> <exclude>src/main/resources/markdown/html/*</exclude> <exclude>src/main/resources/markdown/images/*</exclude> + <exclude>**/src/test/resources/embedded/*.conf</exclude> <!-- contrib --> <exclude>**/JMX-RESOURCES</exclude> <exclude>**/src/main/resources/mainClasses</exclude> |