lib

package
Version: v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DeliveryMode_NON_PERSISTENT int = 1

Used to configure messages to be sent Non-Persistently.

View Source
const DeliveryMode_PERSISTENT int = 2

Used to configure messages to be sent Persistently.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionFactoryImpl

type ConnectionFactoryImpl struct {
	QMName      string
	Hostname    string
	PortNumber  int
	ChannelName string
	UserName    string
	Password    string
}

ConnectionFactoryImpl defines a struct that contains attributes for each of the key properties required to establish a connection to an IBM MQ queue manager.

The fields are defined as Public so that the struct can be initialised programmatically using whatever approach the application prefers.

func (ConnectionFactoryImpl) CreateContext

func (cf ConnectionFactoryImpl) CreateContext() (ContextImpl, error)

CreateContext implements the JMS method to create a connection to an IBM MQ queue manager.

type ConsumerImpl

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

ConsumerImpl defines a struct that contains the necessary objects for receiving messages from a queue on an IBM MQ queue manager.

func (ConsumerImpl) Close

func (consumer ConsumerImpl) Close()

Closes the JMSConsumer, releasing any resources that were allocated on behalf of that consumer.

func (ConsumerImpl) ReceiveNoWait

func (consumer ConsumerImpl) ReceiveNoWait() (*TextMessageImpl, error)

ReceiveNoWait implements the IBM MQ logic necessary to receive a message from a Destination, or immediately return a nil Message if there is no available message to be received.

func (ConsumerImpl) ReceiveStringBodyNoWait

func (consumer ConsumerImpl) ReceiveStringBodyNoWait() (*string, error)

ReceiveStringBodyNoWait implements the IBM MQ logic necessary to receive a message from a Destination and return its body as a string.

If no message is immediately available to be returned then a nil is returned.

type ContextImpl

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

ContextImpl encapsulates the objects necessary to maintain an active connection to an IBM MQ queue manager.

func (ContextImpl) Close

func (ctx ContextImpl) Close()

Close this connection to the MQ queue manager, and release any resources that were allocated to support this connection.

func (*ContextImpl) Commit added in v1.0.5

func (ctx *ContextImpl) Commit() error

func (ContextImpl) CreateConsumer

func (ctx ContextImpl) CreateConsumer(dest Destination) (*ConsumerImpl, error)

CreateConsumer creates a consumer object that allows an application to receive messages from the specified Destination.

func (ContextImpl) CreateConsumerWithSelector

func (ctx ContextImpl) CreateConsumerWithSelector(dest Destination, selector string) (*ConsumerImpl, error)

CreateConsumer creates a consumer object that allows an application to receive messages that match the specified selector from the given Destination.

func (ContextImpl) CreateProducer

func (ctx ContextImpl) CreateProducer() *ProducerImpl

CreateProducer implements the logic necessary to create a JMSProducer object that allows messages to be sent to destinations in IBM MQ.

func (ContextImpl) CreateQueue

func (ctx ContextImpl) CreateQueue(queueName string) *QueueImpl

CreateQueue implements the logic necessary to create a provider-specific object representing an IBM MQ queue.

func (ContextImpl) CreateTextMessage

func (ctx ContextImpl) CreateTextMessage() *TextMessageImpl

CreateTextMessage is a JMS standard mechanism for creating a TextMessage.

func (ContextImpl) CreateTextMessageWithString

func (ctx ContextImpl) CreateTextMessageWithString(txt string) *TextMessageImpl

CreateTextMessage is a JMS standard mechanism for creating a TextMessage and initialise it with the chosen text string.

func (*ContextImpl) Rollback added in v1.0.5

func (ctx *ContextImpl) Rollback() error

func (*ContextImpl) Transaction added in v1.0.5

func (ctx *ContextImpl) Transaction() error

type Destination added in v1.0.5

type Destination interface {

	// GetDestinationName returns the name of the destination represented by this
	// object.
	//
	// In Java JMS this interface contains no methods and is only a parent for the
	// Queue and Topic interfaces, however in Golang an interface with no methods
	// is automatically implemented by every object, so we need to define at least
	// one method here in order to make it meet the JMS style semantics.
	GetDestinationName() string
}

Destination encapsulates a provider-specific address, which is typically specialized as either a Queue or a Topic.

type ProducerImpl

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

ProducerImpl defines a struct that contains the necessary objects for sending messages to a queue on an IBM MQ queue manager.

func (*ProducerImpl) GetDeliveryMode

func (producer *ProducerImpl) GetDeliveryMode() int

GetDeliveryMode returns the current delivery mode that is set on this Producer.

func (*ProducerImpl) GetTimeToLive

func (producer *ProducerImpl) GetTimeToLive() int

GetTimeToLive returns the current time to live that is set on this Producer.

func (ProducerImpl) Send

func (producer ProducerImpl) Send(dest Destination, msg *TextMessageImpl) error

Send a message to the specified IBM MQ queue, using the message options that are defined on this JMSProducer.

func (ProducerImpl) SendRaw

func (producer ProducerImpl) SendRaw(dest Destination, msg *TextMessageImpl, options *int32) error

SendRaw - send raw message

func (ProducerImpl) SendString

func (producer ProducerImpl) SendString(dest Destination, bodyStr string, priority *int32) error

Send a TextMessage with the specified body to the specified Destination using any message options that are defined on this JMSProducer.

func (ProducerImpl) SendStringRaw

func (producer ProducerImpl) SendStringRaw(dest Destination, bodyStr string, options *int32, priority *int32) error

SendStringRaw - send raw string message

func (*ProducerImpl) SetDeliveryMode

func (producer *ProducerImpl) SetDeliveryMode(mode int) *ProducerImpl

SetDeliveryMode contains the MQ logic necessary to store the specified delivery mode parameter inside the Producer object so that it can be applied when sending messages using this Producer.

func (*ProducerImpl) SetTimeToLive

func (producer *ProducerImpl) SetTimeToLive(timeToLive int) *ProducerImpl

SetTimeToLive contains the MQ logic necessary to store the specified time to live parameter inside the Producer object so that it can be applied when sending messages using this Producer.

type QueueImpl

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

QueueImpl encapsulates the provider-specific attributes necessary to communicate with an IBM MQ queue.

func (QueueImpl) GetDestinationName

func (queue QueueImpl) GetDestinationName() string

GetDestinationName returns the name of the destination represented by this object.

func (QueueImpl) GetQueueName

func (queue QueueImpl) GetQueueName() string

GetQueueName returns the provider-specific name of the queue that is represented by this object.

type TextMessageImpl

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

TextMessageImpl contains the IBM MQ specific attributes necessary to present a message that carries a string.

func (*TextMessageImpl) GetJMSCorrelationID

func (msg *TextMessageImpl) GetJMSCorrelationID() string

GetJMSCorrelationID retrieves the correl ID from the native MQ message descriptor field.

func (*TextMessageImpl) GetJMSDeliveryMode

func (msg *TextMessageImpl) GetJMSDeliveryMode() int

GetJMSDeliveryMode extracts the persistence setting from this message and returns it in the JMS delivery mode format.

func (*TextMessageImpl) GetJMSMessageID

func (msg *TextMessageImpl) GetJMSMessageID() string

GetJMSMessageID extracts the message ID from the native MQ message descriptor.

func (*TextMessageImpl) GetJMSReplyTo

func (msg *TextMessageImpl) GetJMSReplyTo() Destination

GetJMSReplyTo extracts the native reply information from the MQ message and populates it into a Destination object.

func (*TextMessageImpl) GetJMSTimestamp

func (msg *TextMessageImpl) GetJMSTimestamp() int64

GetJMSTimestamp retrieves the timestamp at which the message was sent from the native MQ message descriptor fields.

func (*TextMessageImpl) GetText

func (msg *TextMessageImpl) GetText() *string

GetText returns the string that is contained in this TextMessage.

func (*TextMessageImpl) SetJMSCorrelationID

func (msg *TextMessageImpl) SetJMSCorrelationID(correlID string) error

SetJMSCorrelationID applies the specified correlation ID string to the native MQ message field used for correlation purposes.

func (*TextMessageImpl) SetJMSReplyTo

func (msg *TextMessageImpl) SetJMSReplyTo(dest Destination) error

SetJMSReplyTo uses the specified Destination object to configure the reply attributes of the native MQ message fields.

func (*TextMessageImpl) SetPriority added in v1.0.7

func (msg *TextMessageImpl) SetPriority(priority int32)

Set Message priority

func (*TextMessageImpl) SetText

func (msg *TextMessageImpl) SetText(newBody string)

SetText stores the supplied string so that it can be transmitted as part of this TextMessage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL