(connect grpc-channel)
Attempts to connect to a Liftbridge server using the provided gRPC channel
Attempts to connect to a Liftbridge server using the provided gRPC channel
(create-stream this
stream-name
{:keys [subject replication-factor group partitions] :as opts})
Creates a stream. Arguments:
stream-name
A name string which uniquely identifies the stream in the
Liftbridge cluster. Attempting to create another stream with the same
name will result in an error.
subject
A subject string which is the NATS subject to attach the stream
to. If the stream has more than one partition, this is used as the base
subject for each partition. If the subject is not set, it will use
stream-name
instead.
Other supported optional arguments are replication-factor
,
max-replication
, group
, and partitions
. Refer to the official
Liftbridge documentation for more information on this options.
Creates a stream. Arguments: - `stream-name` A name string which uniquely identifies the stream in the Liftbridge cluster. Attempting to create another stream with the same name will result in an error. - `subject` A subject string which is the NATS subject to attach the stream to. If the stream has more than one partition, this is used as the base subject for each partition. If the subject is not set, it will use `stream-name` instead. Other supported optional arguments are `replication-factor`, `max-replication`, `group`, and `partitions`. Refer to the official Liftbridge documentation for more information on this options.
(publish this subject message)
Publishes message
to the NATS subject
. This is a work in progress.
Publishes `message` to the NATS `subject`. This is a work in progress.
(subscribe this
stream-name
{:keys [partition-number start-at start-at-offset start-at-time
start-at-time-delta handler-fn]
:as opts})
Subscribes to a stream identified by stream-name
. Returns a core.async
channel where messages are published. Options are:
partition-number
Specifies the stream partition to consume. Defaults to
0
start-at
Sets the start position. Can be:
:liftbridge.start-at/new-only
Sets the subscription start position to
new messages received in the stream.
:liftbridge.start-at/earliest-received
Sets the subscription start
position to the earliest message received in the stream.
:liftbridge.start-at/latest-received
Sets the subscription start
position to the last message received in the stream.
:liftbridge.start-at/offset
Uses start-offset
to set start
position.
:liftbridge.start-at/timestamp
Uses start-timestamp-nanos
option to
set start position.
start-offset
Sets the subscription start position to the first
message with an offset greater than or equal to the given offset.
start-timestamp-nanos
Sets the subscription start position to the first
message with a timestamp, in nanoseconds, greater than or equal to the
given instant.
async-chan
Channel to be used instead of (clojure.core.async/chan)
.
Currently, Subscribe can only subscribe to a single partition. In the future, there will be functionality for consuming all partitions.
If an error occurs during consumption, the throwable object is published to the channel and the channel is closed.
To close the subscription, shut down the underlying channel.
Subscribes to a stream identified by `stream-name`. Returns a core.async channel where messages are published. Options are: - `partition-number` Specifies the stream partition to consume. Defaults to `0` - `start-at` Sets the start position. Can be: - `:liftbridge.start-at/new-only` Sets the subscription start position to new messages received in the stream. - `:liftbridge.start-at/earliest-received` Sets the subscription start position to the earliest message received in the stream. - `:liftbridge.start-at/latest-received` Sets the subscription start position to the last message received in the stream. - `:liftbridge.start-at/offset` Uses `start-offset` to set start position. - `:liftbridge.start-at/timestamp` Uses `start-timestamp-nanos` option to set start position. - `start-offset` Sets the subscription start position to the first message with an offset greater than or equal to the given offset. - `start-timestamp-nanos` Sets the subscription start position to the first message with a timestamp, in nanoseconds, greater than or equal to the given instant. - `async-chan` Channel to be used instead of `(clojure.core.async/chan)`. Currently, Subscribe can only subscribe to a single partition. In the future, there will be functionality for consuming all partitions. If an error occurs during consumption, the throwable object is published to the channel and the channel is closed. To close the subscription, shut down the underlying channel.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close