topicreaderexamples

package
v0.0.0-...-9a6bae3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitNotify

func CommitNotify(ctx context.Context, db ydb.Connection)

CommitNotify is example for receive commit notifications with async commit mode

func ExplicitPartitionStartStopHandler

func ExplicitPartitionStartStopHandler(ctx context.Context, db ydb.Connection)

ExplicitPartitionStartStopHandler is example for create own handler for stop partition event from server

func OwnReadProgressStorage

func OwnReadProgressStorage(ctx context.Context, db ydb.Connection)

OwnReadProgressStorage example about store reading progress in external system and don't use commit messages to YDB

func PartitionGracefulStopHandled

func PartitionGracefulStopHandled(ctx context.Context, db ydb.Connection)

PartitionGracefulStopHandled is example of sdk handle server signal about graceful stop partition

func PartitionStartStopHandlerAndOwnReadProgressStorage

func PartitionStartStopHandlerAndOwnReadProgressStorage(ctx context.Context, db ydb.Connection)

PartitionStartStopHandlerAndOwnReadProgressStorage example of complex use explicit start/stop partition handler and own progress storage in external system

func PartitionStopHandled

func PartitionStopHandled(ctx context.Context, reader *topicreader.Reader)

PartitionStopHandled is example of sdk handle server signal about stop partition

func PrintMessageContent

func PrintMessageContent(ctx context.Context, reader *topicreader.Reader)

PrintMessageContent is simple example for easy start read messages it is not recommend way for heavy-load processing, batch processing usually will faster

func ProcessMessagesWithSyncCommit

func ProcessMessagesWithSyncCommit(ctx context.Context, db ydb.Connection)

ProcessMessagesWithSyncCommit example about guarantee wait for commit accepted by server

func ReadMessagesByBatch

func ReadMessagesByBatch(ctx context.Context, reader *topicreader.Reader)

ReadMessagesByBatch it is recommended way for process messages

func ReadMessagesWithCustomBatching

func ReadMessagesWithCustomBatching(ctx context.Context, db ydb.Connection)

ReadMessagesWithCustomBatching example of custom of readed message batch

func UnmarshalMessageContentToJSONStruct

func UnmarshalMessageContentToJSONStruct(msg *topicreader.Message)

UnmarshalMessageContentToJSONStruct is example for effective way for unmarshal json message content to value

func UnmarshalMessageContentToOwnType

func UnmarshalMessageContentToOwnType(ctx context.Context, reader *topicreader.Reader)

UnmarshalMessageContentToOwnType is example about effective unmarshal own format from message content

func UnmarshalMessageContentToProtobufStruct

func UnmarshalMessageContentToProtobufStruct(msg *topicreader.Message)

UnmarshalMessageContentToProtobufStruct is example for effective way for unmarshal protobuf message content to value

Types

type MyMessage

type MyMessage struct {
	ID         byte
	ChangeType byte
	Delta      uint32
}

MyMessage example type with own serialization

func (*MyMessage) UnmarshalYDBTopicMessage

func (m *MyMessage) UnmarshalYDBTopicMessage(data []byte) error

UnmarshalYDBTopicMessage implements topicreader.MessageContentUnmarshaler interface

Jump to

Keyboard shortcuts

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