mq

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CECorrelIDAttr          = "correlationid"
	KeyRepositoryExtensions = ".kdb"
)

IBM MQ source adapter constants.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(conn ConnectionConfig, auth Auth) (ibmmq.MQQueueManager, error)

NewConnection creates the connection to IBM MQ server.

Types

type Auth added in v1.14.0

type Auth struct {
	Username string `envconfig:"USER"`
	Password string `envconfig:"PASSWORD"`
	TLSConfig
}

Auth contains IBM MQ authentication parameters.

type ConnectionConfig added in v1.14.0

type ConnectionConfig struct {
	QueueManager   string `envconfig:"QUEUE_MANAGER"`
	ChannelName    string `envconfig:"CHANNEL_NAME"`
	ConnectionName string `envconfig:"CONNECTION_NAME"`
	QueueName      string `envconfig:"QUEUE_NAME"`
}

ConnectionConfig is IBM MQ common connection parameters.

type Delivery

type Delivery struct {
	DeadLetterQManager string `envconfig:"DEAD_LETTER_QUEUE_MANAGER"`
	DeadLetterQueue    string `envconfig:"DEAD_LETTER_QUEUE"`
	BackoffDelay       int    `envconfig:"BACKOFF_DELAY"`
	Retry              int    `envconfig:"DELIVERY_RETRY"`
}

Delivery holds the delivery parameters used in the source.

type Handler

type Handler func([]byte, string) error

Handler is a function used as IBM MQ callback.

type Object

type Object struct {
	// contains filtered or unexported fields
}

Object is a local wrapper for IBM MQ objects required to communicate with the queue.

func OpenQueue

func OpenQueue(queueName string, dlqName string, conn ibmmq.MQQueueManager) (Object, error)

OpenQueue opens IBM MQ queue.

func (*Object) Close

func (q *Object) Close() error

Close closes the queue.

func (*Object) DeleteMessageHandle

func (q *Object) DeleteMessageHandle() error

Deallocate the message handle

func (*Object) DeregisterCallback

func (q *Object) DeregisterCallback() error

Deregister the callback function - have to do this before the message handle can be successfully deleted

func (*Object) PutToDLQ added in v1.14.0

func (q *Object) PutToDLQ(mqmd *ibmmq.MQMD, data []byte) error

Put puts the message to the queue.

func (*Object) RegisterCallback

func (q *Object) RegisterCallback(f Handler, delivery Delivery, logger *zap.SugaredLogger) error

RegisterCallback registers the callback function for the incoming messages in the target queue.

func (*Object) StartListen

func (q *Object) StartListen(conn ibmmq.MQQueueManager) error

StartListen sends the signal to IBM MQ server to start callback invocation.

func (*Object) StopCallback

func (q *Object) StopCallback(conn ibmmq.MQQueueManager) error

Stop the callback function from being called again

type TLSConfig added in v1.14.0

type TLSConfig struct {
	Cipher             string `envconfig:"TLS_CIPHER"`
	ClientAuthRequired bool   `envconfig:"TLS_CLIENT_AUTH"`
	CertLabel          string `envconfig:"TLS_CERT_LABEL"`
}

TLSConfig holds TLS connection parameters.

Jump to

Keyboard shortcuts

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