⚑Quick Start

Setup Build Tools (Maven or Gradle)

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
    
<dependencies>
    <dependency>
        <groupId>com.github.Szczurowsky</groupId>
        <artifactId>RatOverNATS</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

Connect to NATS server

public class Main {

    public static void main(String[] args) {
        RatOverNats ratOverNats = new RatOverNatsBuilder()
                .uri("nats://localhost:4222")
                .build();
    }

}

Register message handler

As you can see in constructor we've two values. First is packet id and second is channel name

Register handler

Publish message

Here we're setting packetId to 1 and channel to test with payload - string also test

Last updated