Documentation
¶
Overview ¶
Package publisher provides functionality for publishing messages to a STOMP broker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// ContentType is the MIME type of the message body.
ContentType string
// Body is the raw message content.
Body []byte
// Opts are publication options (headers, etc.).
Opts []PublishOption
}
Message represents a message to be published to a STOMP broker.
type Middleware ¶
type Middleware func(next RoundTripper) RoundTripper
Middleware is a function that wraps a RoundTripper with additional functionality.
type Option ¶
type Option func(p *Publisher)
Option is a function that applies configuration options to a Publisher.
func WithConnectionOptions ¶
func WithConnectionOptions(connOpts ...consumer.ConnOption) Option
WithConnectionOptions adds connection options to the publisher.
func WithMiddlewares ¶
func WithMiddlewares(mws ...Middleware) Option
WithMiddlewares adds middleware functions to the publisher.
type PublishOption ¶
PublishOption is a function type for configuring message publication.
type Publisher ¶
type Publisher struct {
// Address is the broker address.
Address string
// Queue is the default queue name to publish to.
Queue string
// ConnOpts are connection options.
ConnOpts []consumer.ConnOption
// Middlewares are middleware functions applied to the round tripper.
Middlewares []Middleware
// contains filtered or unexported fields
}
Publisher manages a connection to a STOMP broker for publishing messages.
func NewPublisher ¶
NewPublisher creates a new Publisher with the provided configuration options.
func (*Publisher) Healthcheck ¶ added in v1.58.0
Healthcheck verifies that the publisher can connect to the broker.
type RoundTripper ¶
RoundTripper defines the interface for publishing messages.
type RoundTripperFunc ¶
RoundTripperFunc is an adapter type that allows using functions as round trippers.