Introducing Camel-Nats

In the latest version of Apache Camel (2.17.0) we released camel-nats. NATS, is a cloud-native messaging system from Apcera. The first version of the component was based on java_nats, this library has been deprecated from a while and we decide to switch to the brand new client JNats in the next major release (Camel 2.18.0)

The component

Camel-Nats provides both producing/consuming endpoints. These are the options you can define:

For more information about Nats configuration take a look at the docs

Examples

From the producer perspective:

from("direct:send").to("nats://localhost:4222?topic=test");

while from the consumer perspective you can have:

from("nats://localhost:4222?topic=test&maxMessages=5").to("mock:result")

In this case you will consume messages from the topic test until you received 5 messages.

The message from the consumer will have two headers: