Skip to content

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Codecov Libraries Maven Central

Spring Boot Embedded Zookeeper

A small utility library that easily enables an embedded ZooKeeper server on SpringBoot apps.

This library is published to Maven Central, hence:

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.raonigabriel</groupId>
    <artifactId>spring-boot-embedded-zookeeper</artifactId>
    <version>2.0.7</version>
</dependency>

Usage

Just add @EnableEmbeddedZooKeeper to any @Configuration or @SpringBootApplication class as follows:

package com.myco.myapp;

@EnableEmbeddedZooKeeper
@SpringBootApplication
public class MyApp {

    public static void main(String[] args) {
        SpringApplication.run(MyApp.class, args);
    }
} 

Then you can inject the ZooKeeperServer bean on any Spring component, as following:

package com.myco.myapp;

@Component
public class MyComponent {

	@Autowired
	ZooKeeperServer zookeeperServer;
	
	public void doSomething() {
		// Use the injected zookeeperServer
	}

}

To get the code:

Clone the repository:

$ git clone https://github.com/raonigabriel/spring-boot-embedded-zookeeper.git

If this is your first time using Github, review http://help.github.com to learn the basics.

License

Released under the Apache 2.0 license

About

A small utility library that easily enables an embedded ZooKeeper server on SpringBoot apps.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages