Documentation
¶
Index ¶
- Constants
- func NewConnection(cfg *ConnConfig) (ibmmq.MQQueueManager, error)
- type ConnConfig
- type Delivery
- type EnvConnectionConfig
- type Handler
- type Object
- func (q *Object) Close() error
- func (q *Object) DeleteMessageHandle() error
- func (q *Object) DeregisterCallback() error
- func (q *Object) Put(data []byte, ceCorrelID string) error
- func (q *Object) RegisterCallback(f Handler, delivery *Delivery, log *zap.SugaredLogger) error
- func (q *Object) StartListen(conn ibmmq.MQQueueManager) error
- func (q *Object) StopCallback(conn ibmmq.MQQueueManager) error
- type ReplyTo
Constants ¶
const CECorrelIDAttr = "correlationid"
CECorrelIDAttr is the name of CloudEvent attribute used as IBM MQ Correlation ID.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(cfg *ConnConfig) (ibmmq.MQQueueManager, error)
NewConnection creates the connection to IBM MQ server.
Types ¶
type ConnConfig ¶
type ConnConfig struct { ChannelName string ConnectionName string User string Password string QueueManager string QueueName string }
ConnConfig is a set of connection parameters.
type Delivery ¶
type Delivery struct { DeadLetterQManager string DeadLetterQueue string BackoffDelay int Retry int }
Delivery describes the message delivery details.
type EnvConnectionConfig ¶
type EnvConnectionConfig struct { QueueManager string `envconfig:"QUEUE_MANAGER"` ChannelName string `envconfig:"CHANNEL_NAME"` ConnectionName string `envconfig:"CONNECTION_NAME"` User string `envconfig:"USER"` Password string `envconfig:"PASSWORD"` QueueName string `envconfig:"QUEUE_NAME"` }
EnvConnectionConfig is IBM MQ common connection parameters.
func (*EnvConnectionConfig) ConnectionConfig ¶
func (e *EnvConnectionConfig) ConnectionConfig() *ConnConfig
ConnectionConfig returns the connection configuration.
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, conn ibmmq.MQQueueManager) (Object, error)
OpenQueue opens IBM MQ queue.
func (*Object) DeleteMessageHandle ¶
Deallocate the message handle
func (*Object) DeregisterCallback ¶
Deregister the callback function - have to do this before the message handle can be successfully deleted
func (*Object) RegisterCallback ¶
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