modulepackage
0.0.0-20240327161656-5cd769b67f2b
Repository: https://github.com/uw-labs/substrate.git
Documentation: pkg.go.dev
# README
Substrate
Substrate is a simple thin abstraction for message publishing and consumption. It presents a simple API set for durable, at-least-once message publishing and subscription, on a number of backend message broker types.
The API is not yet stable.
Current implementations and their status
Implementation | Status |
---|---|
Apache Kafka | beta |
Nats streaming | beta |
Proximo | alpha |
Freezer | alpha |
Additional resources
- substrate-tools - Provides wrappers and packages that are useful for various tasks, such as acknowledgement ordering and instrumentation.
# Packages
Package freezer provides freezer support for substrate
Usage
This package support two methods of use.
No description provided by the author
Package kafka provides kafka support for substrate
Usage
This package support two methods of use.
Package natsstreaming provides kafka support for substrate
Usage
This package support two methods of use.
No description provided by the author
Package proximo provides proximo support for substrate
Usage
This package support two methods of use.
Package suburl provides a generic URL based interface for obtaining substrate source and sink objects.
# Functions
NewSynchronousMessageSink returns a new synchronous message sink, given an AsyncMessageSink.
NewSynchronousMessageSource returns a new synchronous message source, given an AsyncMessageSource.
# Variables
ErrSinkAlreadyClosed is an error returned when user tries to publish a message or close a sink after it was already closed.
ErrSinkClosedOrFailedDuringSend is an error returned when a sink is closed or fails while sending a message.
# Structs
InvalidAckError means that a message acknowledgement was not as expected.
Status represents a snapshot of the state of a source or sink.
# Interfaces
AsyncMessageSink represents a message sink that allows publishing messages, and multiple messages can be in flight before any acks are recieved, depending upon the configuration of the underlying message sink.
AsyncMessageSource represents a message source that allows consuming messages, and multiple messages can be in flight before any acks are sent, depending upon the configuration of the underlying message source.
DiscardableMessage allows a consumer to discard the payload after use (but before acking) in order to release memory earlier.
Some brokers have the notion of keyed messages.
Message is the single type that represents all messages in substrate.
Statuser is the interface that wraps the Status method.
SynchronousMessageSink represents a message source that allows "message at a time" publishing and relieves the consumer from having to deal with acknowledgements themselves.
SynchronousMessageSource represents a message source that allows "message at a time" consumption and relieves the consumer from having to deal with acknowledgements themselves.
# Type aliases
ConsumerMessageHandler is the callback function type that synchronous message consumers must implement.