natsstreaming

package
v0.0.0-...-e11bb24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package natsstreaming provides kafka support for substrate

Usage

This package support two methods of use. The first is to directly use this package. See the function documentation for more details.

The second method is to use the suburl package. See https://godoc.org/github.com/charlie/substrate/suburl for more information.

Using suburl

The url structure is nats-streaming://host:port/subject/

The following url parameters are available:

cluster-id  - The nats streaming cluster id
client-id   - The nats streaming client id

The following connection loss detection parameters are available on both source and sink:

ping-timeout - The number of seconds to wait for a ping
ping-num-tries - The number of times pings should time out before the connection is considered dead

Additionally, for sources, the following url parameters are available

queue-group      - The nats streaming queue group
max-in-flight    - The nats streaming MaxInFlight value
ack-wait         - The nats streaming AckWait duration, e.g., '30s', '2m'

Index

Constants

View Source
const (
	// OffsetOldest indicates the oldest appropriate message available on the broker.
	OffsetOldest int64 = -2
	// OffsetNewest indicates the next appropriate message available on the broker.
	OffsetNewest int64 = -1
)

Variables

This section is empty.

Functions

Types

type AsyncMessageSinkConfig

type AsyncMessageSinkConfig struct {
	URL       string
	ClusterID string
	ClientID  string
	Subject   string

	// number in seconds between pings (min 1)
	ConnectionPingInterval int

	// the client will return an error after this many pings have timed out (min 3)
	ConnectionNumPings int
}

AsyncMessageSinkConfig is the configuration parameters for an AsyncMessageSink.

type AsyncMessageSourceConfig

type AsyncMessageSourceConfig struct {
	URL         string
	ClusterID   string
	ClientID    string
	Subject     string
	QueueGroup  string
	MaxInFlight int
	AckWait     time.Duration
	Offset      int64

	// number in seconds between pings (min 1)
	ConnectionPingInterval int

	// the client will return an error after this many pings have timed out (min 3)
	ConnectionNumPings int
}

AsyncMessageSource represents a nats-streaming message source and implements the substrate.AsyncMessageSource interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL