From b78b1baede2f8fcbfffb3fd8920564a69224bd1a Mon Sep 17 00:00:00 2001 From: Linus Taylor Date: Sat, 8 Sep 2018 23:34:27 +0800 Subject: [PATCH] Create README.md --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..69178f6 --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# nats-spring +### Configuring a NATS client in Spring +This project provides support for using Spring Boot with [NATS](https://nats.io/). + +# Quick Start +clone this project +```bash +git clone https://github.com/wanlinus/nats-spring.git +cd nats-spring +mvn clean install +``` + +```xml + + cn.wanlinus + nats-spring + 1.0.0.RELEASE + +``` +The Java SE 8 or higher is recommended to build the project. + +## Basic Usage + +```java +@SpringBootApplication +@EnableNats +public class NatsDemo2Application { + + public static void main(String[] args) { + SpringApplication.run(NatsDemo2Application.class, args); + } +} +``` + +```java + +@Component +public class Foo{ + + @NatsSubscribe("haha") + public void message(Message message) { + System.out.println(message.getSubject() + " : " + new String(message.getData())); + } +} +``` + +# Resources + +For more information, please visit the Nats Spring website at: +[Reference Manual](https://github.com/wanlinus/nats-spring) + + +# License + +Nats-Spring is released under the terms of the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html). + +