A Java examples for the NATS messaging system.
These Java examples of using the NATS Java client nats.java project
In addition to this repository, there are also more examples in the examples folder of the NATS Java client porject.
The starters projects are provided to give you a jump start to adding the NATS Java client to your project.
- starter-gradle-groovy for gradle users who like the Groovy DSL
- starter-gradle-kotlin for gradle users who like the Kotlin DSL
- starter-maven for maven users
Some examples that create streams, publish and subscribe.
The functional examples demonstrate one feature at a time.
The chain of command example shows subscribing with wildcard subjects to form a chain of command. Both "publish style" and "request style" workflow are demonstrated.
The "publish style" does not know if messages were received. The "request style" knows if the request was received, so it could handle the case when it is not.
As a side note for Kotlin users, there is a small example in the kotlin-nats-examples project.
Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.