publish

package
v0.3.0-20260807212926-... 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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