msg

package
v0.0.0-...-941bdb3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Topic      string
	ConsumerID uint64

	Msg     *api.CommandMessage
	Meta    *api.MessageMetadata
	Payload []byte
}

Message represents a received MESSAGE from the Pulsar server.

func (*Message) Equal

func (m *Message) Equal(other *Message) bool

Equal returns true if the provided other Message is equal to the receiver Message.

type MonotonicID

type MonotonicID struct {
	ID uint64
}

MonotonicID handles unique id generation

func (*MonotonicID) Next

func (r *MonotonicID) Next() *uint64

next returns the next ID

type SingleMessage

type SingleMessage struct {
	SingleMetaSize uint32
	SingleMeta     *api.SingleMessageMetadata
	SinglePayload  []byte
}

SingleMessage represents one of the elements of the batch type payload

func DecodeBatchMessage

func DecodeBatchMessage(msg *Message) ([]*SingleMessage, error)

DecodeBatchMessage decode message if num_messages_in_batch exist and bigger than 0

func DecodeBatchPayload

func DecodeBatchPayload(bp []byte, batchNum int32) ([]*SingleMessage, error)

DecodeBatchPayload parses the payload of the batch type If the producer uses the batch function, msg.Payload will be a SingleMessage array structure.

Jump to

Keyboard shortcuts

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