Start United States USA — software NATS.io JetStream Stream Creation With the NATS Java Library

NATS.io JetStream Stream Creation With the NATS Java Library

208
0
TEILEN

JetStream allows you to persist streams of messages; you can start reading from the stream at a specific point in time or start at a specific message …
Join the DZone community and get the full member experience. The NATS Java library with support for JetStream has just been released! JetStream allows you to persist streams of messages, allows consumers to either subscribe in real-time or to access the messages at a later time with the added flexibility to choose from where in the stream you want to start receiving messages. You can start reading from the stream at a specific point in time or start at a specific message sequence number. Since JetStream is built natively into the NATS Server, you get message persistence on top of all of the benefits of core NATS messaging. Stream messages are sent on subjects, just like normal NATS messages, so you can even just use a normal NATS subscription to get messages. Using the stream functionality, however, provides benefits above and beyond regular messaging. There are various ways to create streams. You can use configuration, the command line program (CLI), or you can use the Java client’s JetStream Management API to manage streams. There are several stream functions you can execute with the management API: This article will focus on creating a stream and the available options. The stream is essentially a grouping or organization for a set of subjects. It might identify a business function or logical domain of your business. Every stream needs a name and it must be unique within your account. The stream name itself cannot contain spaces or tabs, a period (.), the greater than wildcard character ( >) or the asterisk wildcard ( *) character. There are several options when creating a stream. There are 2 types of storage, Memory or File, with File being the default.

Continue reading...