Documentation
¶
Overview ¶
Package handler provides functionality for processing STOMP messages and handling results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterFunc ¶
AdapterFunc is an adapter type that allows using functions as handler adapters.
type HandlerAdapter ¶
HandlerAdapter defines the interface for adapting message processing logic.
type Middleware ¶
type Middleware func(next HandlerAdapter) HandlerAdapter
Middleware is a function that wraps a HandlerAdapter with additional functionality.
func Log ¶
func Log(logger log.Logger) Middleware
Log creates a middleware that logs message processing results.
func Recovery ¶ added in v1.53.0
func Recovery() Middleware
Recovery creates a middleware that recovers from panics and requeues the message.
type Result ¶
type Result struct {
// Ack indicates the message should be acknowledged.
Ack bool
// Requeue indicates the message should be requeued (negatively acknowledged).
Requeue bool
// Err contains an error if the processing failed.
Err error
}
Result represents the outcome of message processing.
type ResultHandler ¶
type ResultHandler struct {
// contains filtered or unexported fields
}
ResultHandler wraps a handler adapter with middleware support and result processing.
func NewHandler ¶
func NewHandler(logger log.Logger, adapter HandlerAdapter, middlewares ...Middleware) ResultHandler
NewHandler creates a new ResultHandler with the provided logger, adapter, and optional middleware.