View Source PulsarEx (PulsarEx v0.15.0)

Summary

Functions

Count active (started) consumers for cluster/tenant/namespace/subscription, cheaply - a single Registry scan, no per-consumer calls

List the distinct clusters with started consumers for tenant/namespace/subscription, so callers don't have to know a worker's configured cluster ahead of time. Uses ConsumerIDRegistry rather than ConsumerReadyRegistry so a cluster is still discovered while its consumers are down/reconnecting, not just while healthy.

Desired, active, and ready consumer counts for cluster/tenant/namespace/subscription - desired comes from the consumer manager, active/ready from local registries

List all the consumers on default cluster

List all the consumers for cluster

List all the consumers for cluster on a specific topic

List all the consumers for cluster on a specific topic with specific subscription

Publish a message to pulsar, create a pool of producers if not yet created

Count consumers that have reached the :READY state for cluster/tenant/namespace/subscription

Start consumer from a fully quantified topic

Stop consumers with fully quantified topic

Stop consumers with topic pattern

Types

@type namespace() :: String.t() | Regex.t()
@type subscription() :: String.t()
@type tenant() :: String.t() | Regex.t()
@type topic() :: String.t() | Regex.t()
@type topic_name() :: String.t()

Functions

Link to this function

active_consumers(cluster_name, tenant, namespace, subscription)

View Source

Count active (started) consumers for cluster/tenant/namespace/subscription, cheaply - a single Registry scan, no per-consumer calls

Link to this function

clusters(tenant, namespace, subscription)

View Source

List the distinct clusters with started consumers for tenant/namespace/subscription, so callers don't have to know a worker's configured cluster ahead of time. Uses ConsumerIDRegistry rather than ConsumerReadyRegistry so a cluster is still discovered while its consumers are down/reconnecting, not just while healthy.

Link to this function

consumer_gauges(cluster_name, tenant, namespace, subscription)

View Source

Desired, active, and ready consumer counts for cluster/tenant/namespace/subscription - desired comes from the consumer manager, active/ready from local registries

List all the consumers on default cluster

List all the consumers for cluster

Link to this function

consumers(cluster_name, topic_name)

View Source

List all the consumers for cluster on a specific topic

Link to this function

consumers(cluster_name, topic_name, subscription)

View Source

List all the consumers for cluster on a specific topic with specific subscription

Link to this function

produce(topic_name, payload, message_opts \\ [], producer_opts \\ [])

View Source
@spec produce(String.t(), binary(), keyword(), keyword()) ::
  {:ok,
   %PulsarEx.Proto.MessageIdData{
     __unknown_fields__: term(),
     ack_set: term(),
     batch_index: term(),
     batch_size: term(),
     entryId: term(),
     ledgerId: term(),
     partition: term()
   }}
  | {:error, any()}

Publish a message to pulsar, create a pool of producers if not yet created

Link to this function

ready_consumers(cluster_name, tenant, namespace, subscription)

View Source

Count consumers that have reached the :READY state for cluster/tenant/namespace/subscription

Link to this function

start_consumer(topic_name, subscription, module, opts)

View Source
@spec start_consumer(topic_name(), subscription(), module(), keyword()) ::
  :ok | {:error, any()}

Start consumer from a fully quantified topic

Link to this function

start_consumer(tenant, namespace, topic, subscription, module, opts)

View Source
@spec start_consumer(
  tenant(),
  namespace(),
  topic(),
  subscription(),
  module(),
  keyword()
) ::
  :ok | {:error, any()}

Start consumers with topic pattern

Link to this function

stop_consumer(topic, subscription)

View Source
@spec stop_consumer(topic(), subscription()) :: :ok

Stop consumers with fully quantified topic

Link to this function

stop_consumer(tenant, namespace, topic, subscription)

View Source
@spec stop_consumer(tenant(), namespace(), topic(), subscription()) :: :ok

Stop consumers with topic pattern