stomp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package stomp implements a notification sender using stomp protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Brokers            []string
	Destination        string
	CertFile           string
	KeyFile            string
	CAFile             string
	FailoverRetryDelay float32
}

Config represents the configuration of a Stomp Sender.

type Sender

type Sender struct {
	Config    Config
	StompConn *stomp.Conn
	ConnOpts  []func(*stomp.Conn) error
}

func (*Sender) Configure

func (s *Sender) Configure(config *notification.Config) (bool, error)

Configure verifies stomp config and sets up stomp connection

func (*Sender) Connect

func (s *Sender) Connect() error

Connect - connect to one of a brokers which is currently online

func (*Sender) Disconnect

func (s *Sender) Disconnect()

Disconnect - disconnect from remote broker

func (*Sender) Send

func (s *Sender) Send(notificationName string) error

Send - send notification using STOMP in json format

Send function has failover feature - in case one broker fails it reconnect to another broker and send message again

Jump to

Keyboard shortcuts

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