Registry / messaging / jnats
library2.25.2javamavenunverified

Client library for working with the NATS messaging system.

<dependency> <groupId>io.nats</groupId> <artifactId>jnats</artifactId> <version>2.25.2</version> </dependency>
INSTALL
IMPORT
SIG · JNATS
J
jnats
messagingjavav2.25.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
io.nats.client.Connection

Minimal example to connect to NATS and publish a message.

import io.nats.client.Connection; import io.nats.client.Nats; public class NatsExample { public static void main(String[] args) throws Exception { try (Connection nc = Nats.connect("nats://localhost:4222")) { nc.publish("subject", "Hello NATS".getBytes()); System.out.println("Message published."); } } }
Debug
Known issues
breakingNATS Java client 2.x has breaking API changes from 1.x, especially in connection handling.
fix
Refer to the migration guide when upgrading from 1.x to 2.x.
affects: >=2.0.0
Upgrade
Version history
2.25.2latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
jnats — mvn dependency:get jnats · libregistry