publish

package
v0.3.0-20260807201250-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package publish sends a message to the queue behind a topic key. It owns the lookup-and-send plumbing every orchestrator stage otherwise repeats — resolve the key to a queue and a topic name, wrap the payload in a message, publish — and the message-ID convention that controls deduplication (see UniqueID).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Message

func Message(ctx context.Context, registry consumer.TopicRegistry, key consumer.TopicKey, msgID string, payload []byte, partitionKey string) error

Message publishes payload to the topic registered for key.

msgID selects the dedup behavior, so the caller must choose it deliberately. The queue deduplicates on (topic, partition key, message ID) against every row it has not garbage-collected yet, consumed ones included:

  • A stable msgID (an entity's own ID) makes a repeat publish a silent no-op. Right for a hand-off that must happen at most once per entity.
  • UniqueID(id) makes every publish distinct. Right for signals that are re-sent by design — wake-ups, polls, re-dispatches — where a swallowed repeat would stall the pipeline.

func UniqueID

func UniqueID(id string) string

UniqueID returns a message ID no earlier publish for the same entity has used, so the queue's (topic, partition key, message ID) dedup never swallows the repeat. Use it for every publish that is re-sent by design; reusing the bare entity ID instead would make the second publish a silent no-op.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL