ExESDBGater.Messages.HealthMessages (ex_esdb_gater v0.8.0)

Message definitions and helpers for the :ex_esdb_health PubSub instance.

Handles health monitoring, status checks, and health-related events. Uses consistent topic patterns via ExESDBGater.Topics.

Topic Patterns

  • Store-specific: "{store_id}:health" (e.g. "vehicle_store:health")
  • Cluster-wide: "cluster:health"

Summary

Functions

Broadcast a cluster health update

Broadcast cluster-wide health update using pattern matching

Broadcast a component health update

Broadcast a health check result

Broadcast a node health update

Broadcast store-specific health update using pattern matching

Create a ClusterHealth payload with current timestamp

Get the cluster-wide health topic

Create a ComponentHealth payload with current timestamp

Create a HealthCheck payload with current timestamp

Create a NodeHealth payload with current timestamp

Get the health topic for a specific store

Validate a ClusterHealth message

Validate a ComponentHealth message

Validate a HealthCheck message

Validate a NodeHealth message

Validate and extract a secure message

Functions

broadcast_cluster_health(topic, payload)

Broadcast a cluster health update

broadcast_cluster_health_update(payload)

Broadcast cluster-wide health update using pattern matching

broadcast_component_health(topic, payload)

Broadcast a component health update

broadcast_health_check(topic, payload)

Broadcast a health check result

broadcast_node_health(topic, payload)

Broadcast a node health update

broadcast_store_health(store_id, payload)

Broadcast store-specific health update using pattern matching

cluster_health(status, healthy_nodes, total_nodes, opts \\ [])

Create a ClusterHealth payload with current timestamp

cluster_health_topic()

Get the cluster-wide health topic

component_health(component, node, status, opts \\ [])

Create a ComponentHealth payload with current timestamp

health_check(check_name, node, result, opts \\ [])

Create a HealthCheck payload with current timestamp

node_health(node, status, opts \\ [])

Create a NodeHealth payload with current timestamp

secure_broadcast(topic, message)

store_health_topic(store_id)

Get the health topic for a specific store

validate_cluster_health(message)

Validate a ClusterHealth message

validate_component_health(message)

Validate a ComponentHealth message

validate_health_check(message)

Validate a HealthCheck message

validate_node_health(message)

Validate a NodeHealth message

validate_secure_message(arg1)

Validate and extract a secure message