Documentation
¶
Overview ¶
Package message is defined below
Index ¶
- func AttachCorrelationTag(message *OutboundMessageImpl, bytes []byte) error
- func GetOutboundMessagePointer(message *OutboundMessageImpl) ccsmp.SolClientMessagePt
- func NewOutboundMessageBuilder() solace.OutboundMessageBuilder
- func ReplicationGroupMessageIDFromString(str string) (rgmid.ReplicationGroupMessageID, error)
- func SetAckImmediately(message *OutboundMessageImpl) error
- func SetDeliveryMode(message *OutboundMessageImpl, deliveryMode DeliveryMode) error
- func SetDestination(message *OutboundMessageImpl, destName string) error
- func SetProperties(message *OutboundMessageImpl, properties config.MessagePropertyMap) error
- type DeliveryMode
- type InboundMessageImpl
- func (message *InboundMessageImpl) Dispose()
- func (message *InboundMessageImpl) GetDestinationName() string
- func (message *InboundMessageImpl) GetMessageDiscardNotification() message.MessageDiscardNotification
- func (message *InboundMessageImpl) GetReplicationGroupMessageID() (rgmid.ReplicationGroupMessageID, bool)
- func (message *InboundMessageImpl) GetSenderID() (string, bool)
- func (message *InboundMessageImpl) GetSenderTimestamp() (time.Time, bool)
- func (message *InboundMessageImpl) GetTimeStamp() (time.Time, bool)
- func (message *InboundMessageImpl) IsRedelivered() bool
- type MessageID
- type MessageImpl
- func (message *MessageImpl) GetApplicationMessageID() (applicationMessageID string, ok bool)
- func (message *MessageImpl) GetApplicationMessageType() (applicationMessageType string, ok bool)
- func (message *MessageImpl) GetClassOfService() int
- func (message *MessageImpl) GetCorrelationID() (id string, ok bool)
- func (message *MessageImpl) GetExpiration() time.Time
- func (message *MessageImpl) GetHTTPContentEncoding() (contentEncoding string, ok bool)
- func (message *MessageImpl) GetHTTPContentType() (contentType string, ok bool)
- func (message *MessageImpl) GetPayloadAsBytes() (bytes []byte, ok bool)
- func (message *MessageImpl) GetPayloadAsMap() (sdt.Map, bool)
- func (message *MessageImpl) GetPayloadAsStream() (sdtStream sdt.Stream, ok bool)
- func (message *MessageImpl) GetPayloadAsString() (str string, ok bool)
- func (message *MessageImpl) GetPriority() (priority int, ok bool)
- func (message *MessageImpl) GetProperties() (propMap sdt.Map)
- func (message *MessageImpl) GetProperty(propertyName string) (propertyValue sdt.Data, present bool)
- func (message *MessageImpl) GetSequenceNumber() (sequenceNumber int64, ok bool)
- func (message *MessageImpl) HasProperty(propertyName string) bool
- func (message *MessageImpl) IsDisposed() bool
- func (message *MessageImpl) String() string
- type OutboundMessageBuilderImpl
- func (builder *OutboundMessageBuilderImpl) Build(additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
- func (builder *OutboundMessageBuilderImpl) BuildWithByteArrayPayload(payload []byte, ...) (message.OutboundMessage, error)
- func (builder *OutboundMessageBuilderImpl) BuildWithMapPayload(payload sdt.Map, ...) (message.OutboundMessage, error)
- func (builder *OutboundMessageBuilderImpl) BuildWithStreamPayload(payload sdt.Stream, ...) (message.OutboundMessage, error)
- func (builder *OutboundMessageBuilderImpl) BuildWithStringPayload(payload string, ...) (message.OutboundMessage, error)
- func (builder *OutboundMessageBuilderImpl) FromConfigurationProvider(properties config.MessagePropertiesConfigurationProvider) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) String() string
- func (builder *OutboundMessageBuilderImpl) WithApplicationMessageID(messageID string) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithApplicationMessageType(messageType string) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithCorrelationID(correlationID string) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithExpiration(t time.Time) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithHTTPContentHeader(key string, value string) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithPriority(priority int) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithProperty(propertyName config.MessageProperty, propertyValue interface{}) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithSenderID(senderID string) solace.OutboundMessageBuilder
- func (builder *OutboundMessageBuilderImpl) WithSequenceNumber(sequenceNumber uint64) solace.OutboundMessageBuilder
- type OutboundMessageImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachCorrelationTag ¶
func AttachCorrelationTag(message *OutboundMessageImpl, bytes []byte) error
AttachCorrelationTag function
func GetOutboundMessagePointer ¶
func GetOutboundMessagePointer(message *OutboundMessageImpl) ccsmp.SolClientMessagePt
GetOutboundMessagePointer function
func NewOutboundMessageBuilder ¶
func NewOutboundMessageBuilder() solace.OutboundMessageBuilder
NewOutboundMessageBuilder function
func ReplicationGroupMessageIDFromString ¶
func ReplicationGroupMessageIDFromString(str string) (rgmid.ReplicationGroupMessageID, error)
ReplicationGroupMessageIDFromString function
func SetAckImmediately ¶
func SetAckImmediately(message *OutboundMessageImpl) error
SetAckImmediately function
func SetDeliveryMode ¶
func SetDeliveryMode(message *OutboundMessageImpl, deliveryMode DeliveryMode) error
SetDeliveryMode function
func SetDestination ¶
func SetDestination(message *OutboundMessageImpl, destName string) error
SetDestination function
func SetProperties ¶
func SetProperties(message *OutboundMessageImpl, properties config.MessagePropertyMap) error
SetProperties function
Types ¶
type DeliveryMode ¶
type DeliveryMode uint32
DeliveryMode type
const DeliveryModeDirect DeliveryMode = ccsmp.SolClientDeliveryModeDirect
DeliveryModeDirect constant
const DeliveryModeNonPersistent DeliveryMode = ccsmp.SolClientDeliveryModeNonPersistent
DeliveryModeNonPersistent constant
const DeliveryModePersistent DeliveryMode = ccsmp.SolClientDeliveryModePersistent
DeliveryModePersistent constant
type InboundMessageImpl ¶
type InboundMessageImpl struct { MessageImpl // contains filtered or unexported fields }
InboundMessageImpl structure
func NewInboundMessage ¶
func NewInboundMessage(msgP ccsmp.SolClientMessagePt, discard bool) *InboundMessageImpl
NewInboundMessage returns a new Message object that can be used
func (*InboundMessageImpl) Dispose ¶
func (message *InboundMessageImpl) Dispose()
Dispose will free all underlying resources of the Disposable instance. Dispose is idempotent, and will remove any redundant finalizers on the instance, substantially improving garbage collection performance. This function is threadsafe, and subsequent calls to Dispose will block waiting for the first call to complete. Additional calls will return immediately. The instance is considered unusable after Dispose has been called.
func (*InboundMessageImpl) GetDestinationName ¶
func (message *InboundMessageImpl) GetDestinationName() string
GetDestinationName gets the destination name on which the message was received. The destination may be either a topic or a queue. Returns an empty string if the information is not available.
func (*InboundMessageImpl) GetMessageDiscardNotification ¶
func (message *InboundMessageImpl) GetMessageDiscardNotification() message.MessageDiscardNotification
GetMessageDiscardNotification retrieves the message discard notification about previously discarded messages. Returns a MessageDiscardNotification, not expected to be nil.
func (*InboundMessageImpl) GetReplicationGroupMessageID ¶
func (message *InboundMessageImpl) GetReplicationGroupMessageID() (rgmid.ReplicationGroupMessageID, bool)
GetReplicationGroupMessageID function
func (*InboundMessageImpl) GetSenderID ¶
func (message *InboundMessageImpl) GetSenderID() (string, bool)
GetSenderID will get the sender ID set on the message.
func (*InboundMessageImpl) GetSenderTimestamp ¶
func (message *InboundMessageImpl) GetSenderTimestamp() (time.Time, bool)
GetSenderTimestamp will get the timestamp as time.Time. This timestamp is often set automatically when the message is published.
func (*InboundMessageImpl) GetTimeStamp ¶
func (message *InboundMessageImpl) GetTimeStamp() (time.Time, bool)
GetTimeStamp will get the timestamp as time.Time. This timestamp represents the time that the message was received by the API. This may differ from the time that the message is received by the MessageReceiver.
func (*InboundMessageImpl) IsRedelivered ¶
func (message *InboundMessageImpl) IsRedelivered() bool
IsRedelivered function
type MessageID ¶
type MessageID = ccsmp.SolClientMessageID
MessageID defined
func GetMessageID ¶
func GetMessageID(message *InboundMessageImpl) (MessageID, bool)
GetMessageID function
type MessageImpl ¶
type MessageImpl struct {
// contains filtered or unexported fields
}
MessageImpl structure
func (*MessageImpl) GetApplicationMessageID ¶
func (message *MessageImpl) GetApplicationMessageID() (applicationMessageID string, ok bool)
GetApplicationMessageID will return the Application Message ID of the message. This value is used by applications only and is passed through the API untouched. If not set, will return an empty string and ok false.
func (*MessageImpl) GetApplicationMessageType ¶
func (message *MessageImpl) GetApplicationMessageType() (applicationMessageType string, ok bool)
GetApplicationMessageType will return the Application Message Type of the message. This value is used by applications only and is passed through the API untouched. If not set, will return an empty string and ok false.
func (*MessageImpl) GetClassOfService ¶
func (message *MessageImpl) GetClassOfService() int
GetClassOfService function
func (*MessageImpl) GetCorrelationID ¶
func (message *MessageImpl) GetCorrelationID() (id string, ok bool)
GetCorrelationID will return the correlation ID of the message. If not present, id will be an empty string and ok will be false.
func (*MessageImpl) GetExpiration ¶
func (message *MessageImpl) GetExpiration() time.Time
GetExpiration will return the expiration time of the message. The expiration time is UTC time when the message is discarded or moved to the Dead Message Queue by the PubSub+ broker. A value of 0 (as determined by time.isZero()) indicates that the message never expires. The default value is 0.
func (*MessageImpl) GetHTTPContentEncoding ¶
func (message *MessageImpl) GetHTTPContentEncoding() (contentEncoding string, ok bool)
GetHTTPContentEncoding will return the HTTPContentEncoding set on the message. If not set, will return an empty string and ok false.
func (*MessageImpl) GetHTTPContentType ¶
func (message *MessageImpl) GetHTTPContentType() (contentType string, ok bool)
GetHTTPContentType will return the HTTPContentType set on the message. If not set, will return an empty string and ok false.
func (*MessageImpl) GetPayloadAsBytes ¶
func (message *MessageImpl) GetPayloadAsBytes() (bytes []byte, ok bool)
GetPayloadAsBytes will attempt to get the payload of the message as a byte array. Will return bytes containing the byte array and an ok flag indicating if it was successful. If the content is not accessible in byte array form, an empty slice will be returned and the ok flag will be false.
func (*MessageImpl) GetPayloadAsMap ¶
func (message *MessageImpl) GetPayloadAsMap() (sdt.Map, bool)
GetPayloadAsMap will attempt to get the payload of the message as an SDTMap. Will return a SDTMap instance containing the data stored in the message and an ok indicating if it was success. If the content is not accessible in SDTMap form, sdtMap will be nil and ok will be false.
func (*MessageImpl) GetPayloadAsStream ¶
func (message *MessageImpl) GetPayloadAsStream() (sdtStream sdt.Stream, ok bool)
GetPayloadAsStream will attempt to get the payload of the message as an SDTStream. Will return a SDTStream instance containing the data stored in the message and an ok indicating if it was success. If the content is not accessible in SDTStream form, sdtStream will be nil and ok will be false.
func (*MessageImpl) GetPayloadAsString ¶
func (message *MessageImpl) GetPayloadAsString() (str string, ok bool)
GetPayloadAsString will attempt to get the payload of the message as a string. Will return a string containing the data stored in the message and an ok flag indicating if it was successful. If the content is not accessible in string form, an empty string will be returned and the ok flag will be false.
func (*MessageImpl) GetPriority ¶
func (message *MessageImpl) GetPriority() (priority int, ok bool)
GetPriority will return the priority value. Valid priorities range from 0 to 255. Returns the priority, or ok of false if not set.
func (*MessageImpl) GetProperties ¶
func (message *MessageImpl) GetProperties() (propMap sdt.Map)
GetProperties will return a map of properties where the keys are MessageProperty constants
func (*MessageImpl) GetProperty ¶
func (message *MessageImpl) GetProperty(propertyName string) (propertyValue sdt.Data, present bool)
GetProperty will return a property, and a boolean indicating if its present. Will return nil if not found. Property can be present and set to nil. propertyName is the MessageProperty to get. See MessageProperty constants for possible values.
func (*MessageImpl) GetSequenceNumber ¶
func (message *MessageImpl) GetSequenceNumber() (sequenceNumber int64, ok bool)
GetSequenceNumber will return the sequence number of the message. Sequence numbers may be set by the publisher applications or automatically generated by the publisher APIs. The sequence number is carried in the Message meta data in addition to the payload and may be retrieved by consumer applications. Returns a positive sequenceNumber if set, or ok of false if not set.
func (*MessageImpl) HasProperty ¶
func (message *MessageImpl) HasProperty(propertyName string) bool
HasProperty will return whether or not a property is present in the Message. propertyName is the MessageProperty to get. See MessageProperty constants for possible values.
func (*MessageImpl) IsDisposed ¶
func (message *MessageImpl) IsDisposed() bool
IsDisposed checks if the Disposable instance has been disposed by a call to Dispose. IsDisposeed returns true if Dispose has been called and false if it is still usable. Dispose may or may not have returned. The instance is considered unusable if IsDisposed returns true.
func (*MessageImpl) String ¶
func (message *MessageImpl) String() string
type OutboundMessageBuilderImpl ¶
type OutboundMessageBuilderImpl struct {
// contains filtered or unexported fields
}
OutboundMessageBuilderImpl structure
func (*OutboundMessageBuilderImpl) Build ¶
func (builder *OutboundMessageBuilderImpl) Build(additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
Build method
func (*OutboundMessageBuilderImpl) BuildWithByteArrayPayload ¶
func (builder *OutboundMessageBuilderImpl) BuildWithByteArrayPayload(payload []byte, additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
BuildWithByteArrayPayload builds a new message with a byte array payload. Returns the built message or an error if one occurred. Returns solace/solace.*InvalidConfigurationError if an invalid configuration is provided.
func (*OutboundMessageBuilderImpl) BuildWithMapPayload ¶
func (builder *OutboundMessageBuilderImpl) BuildWithMapPayload(payload sdt.Map, additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
BuildWithMapPayload builds a new message with a SDTMap payload. If invalid data, ie. data not allowed as SDTData, is found in the map, this function will return a nil OutboundMessage and an error. Returns a solace/solace.*IllegalArgumentError if an invalid payload is given. Returns solace/solace.*InvalidConfigurationError if an invalid configuration is provided.
func (*OutboundMessageBuilderImpl) BuildWithStreamPayload ¶
func (builder *OutboundMessageBuilderImpl) BuildWithStreamPayload(payload sdt.Stream, additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
BuildWithStreamPayload builds a new message with a SDTStream payload. If invalid data, ie. data not allowed as SDTData, is found in the stream, this function will return a nil OutboundMessage and an error. Returns a solace/solace.*IllegalArgumentError if an invalid payload is given. Returns solace/solace.*InvalidConfigurationError if an invalid configuration is provided.
func (*OutboundMessageBuilderImpl) BuildWithStringPayload ¶
func (builder *OutboundMessageBuilderImpl) BuildWithStringPayload(payload string, additionalConfiguration ...config.MessagePropertiesConfigurationProvider) (message.OutboundMessage, error)
BuildWithStringPayload builds a new message with a string payload. Returns solace/solace.*InvalidConfigurationError if an invalid configuration is provided.
func (*OutboundMessageBuilderImpl) FromConfigurationProvider ¶
func (builder *OutboundMessageBuilderImpl) FromConfigurationProvider(properties config.MessagePropertiesConfigurationProvider) solace.OutboundMessageBuilder
FromConfigurationProvider will set the given properties to the resulting message.
func (*OutboundMessageBuilderImpl) String ¶
func (builder *OutboundMessageBuilderImpl) String() string
func (*OutboundMessageBuilderImpl) WithApplicationMessageID ¶
func (builder *OutboundMessageBuilderImpl) WithApplicationMessageID(messageID string) solace.OutboundMessageBuilder
WithApplicationMessageID sets the application message ID of the message.
func (*OutboundMessageBuilderImpl) WithApplicationMessageType ¶
func (builder *OutboundMessageBuilderImpl) WithApplicationMessageType(messageType string) solace.OutboundMessageBuilder
WithApplicationMessageType sets the application message type for a message.
func (*OutboundMessageBuilderImpl) WithCorrelationID ¶
func (builder *OutboundMessageBuilderImpl) WithCorrelationID(correlationID string) solace.OutboundMessageBuilder
WithCorrelationID sets the correlation ID for the message.
func (*OutboundMessageBuilderImpl) WithExpiration ¶
func (builder *OutboundMessageBuilderImpl) WithExpiration(t time.Time) solace.OutboundMessageBuilder
WithExpiration will set the message expiration time to the given time.
func (*OutboundMessageBuilderImpl) WithHTTPContentHeader ¶
func (builder *OutboundMessageBuilderImpl) WithHTTPContentHeader(key string, value string) solace.OutboundMessageBuilder
WithHTTPContentHeader sets the desired http content header on the message.
func (*OutboundMessageBuilderImpl) WithPriority ¶
func (builder *OutboundMessageBuilderImpl) WithPriority(priority int) solace.OutboundMessageBuilder
WithPriority sets the priority of the message where the priority is a value between 0 and 255.
func (*OutboundMessageBuilderImpl) WithProperty ¶
func (builder *OutboundMessageBuilderImpl) WithProperty(propertyName config.MessageProperty, propertyValue interface{}) solace.OutboundMessageBuilder
WithProperty sets an individual property on a message.
func (*OutboundMessageBuilderImpl) WithSenderID ¶
func (builder *OutboundMessageBuilderImpl) WithSenderID(senderID string) solace.OutboundMessageBuilder
WithSenderID sets the sender ID for a message from a string.
func (*OutboundMessageBuilderImpl) WithSequenceNumber ¶
func (builder *OutboundMessageBuilderImpl) WithSequenceNumber(sequenceNumber uint64) solace.OutboundMessageBuilder
WithSequenceNumber sets the sequence number for the message
type OutboundMessageImpl ¶
type OutboundMessageImpl struct {
MessageImpl
}
OutboundMessageImpl structure
func DuplicateOutboundMessage ¶
func DuplicateOutboundMessage(message *OutboundMessageImpl) (*OutboundMessageImpl, error)
DuplicateOutboundMessage will duplicate the message and return a new Message copying the original
func NewOutboundMessage ¶
func NewOutboundMessage() (*OutboundMessageImpl, error)
NewOutboundMessage returns a new Message object that can be used
func (*OutboundMessageImpl) Dispose ¶
func (message *OutboundMessageImpl) Dispose()
Dispose will free all underlying resources of the Disposable instance. Dispose is idempotent, and will remove any redundant finalizers on the instance, substantially improving garbage collection performance. This function is threadsafe, and subsequent calls to Dispose will block waiting for the first call to complete. Additional calls will return immediately. The instance is considered unusable after Dispose has been called.