Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*nats.Conn
JetStream jetstream.JetStream
// contains filtered or unexported fields
}
func (*Client) CreateOrUpdateStream ¶
type ProcessingError ¶
type ProcessingError struct {
// contains filtered or unexported fields
}
func NakError ¶
func NakError(err error) *ProcessingError
func NakWithDelayError ¶
func NakWithDelayError(err error, delay time.Duration) *ProcessingError
func TermError ¶
func TermError(err error) *ProcessingError
func (*ProcessingError) Error ¶
func (e *ProcessingError) Error() string
func (*ProcessingError) Unwrap ¶
func (e *ProcessingError) Unwrap() error
type Processor ¶
func NewProcessor ¶
func NewProcessor[T proto.Message](client *Client, config *ProcessorConfig, processorFunc ProcessorFunc[T], opts ...ProcessorOpt[T]) *Processor[T]
func (*Processor[T]) HealthCheck ¶
HealthCheck checks the health of this routine.
func (*Processor[T]) WithLogger ¶
func (*Processor[T]) WithMetrics ¶
type ProcessorConfig ¶
type ProcessorConfig struct {
Subjects []*Subject
ConsumerName string
MaxConsecutiveErrors int
BatchSize int
FetchTimeout time.Duration
AckWait time.Duration
BackoffSeconds int
// DeliverFromLatest configures the consumer to start from the latest offset on creation.
// This only takes effect when the consumer is first created; existing consumers retain their cursor.
DeliverFromLatest bool
}
type ProcessorFunc ¶
type ProcessorOpt ¶
func WithGroupKey ¶
WithGroupKey groups messages by the returned key. Messages within a group are processed serially in the order they were received; groups are processed in parallel.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func NewStream ¶
func NewStream(streamOptions *natspb.StreamOptions) *Stream
Directories
¶
| Path | Synopsis |
|---|---|
|
Package teststore provides a buffered store of the messages a system under test publishes to NATS, so that tests can assert on side effects the RPCs triggering them do not wait for.
|
Package teststore provides a buffered store of the messages a system under test publishes to NATS, so that tests can assert on side effects the RPCs triggering them do not wait for. |