producer

package
v0.0.0-...-094815c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

Introduce

It's a demo to show how to create a simple sync/async producer,and use custom serializer to serialize our message

It is not recommended to use a custom serializer, because of this, both the production side and the client side need to maintain this custom serializer, if upstream changes, downstream needs to change too. Despite this,we can use JSON,Thrift or ProtoBuf to serialize our message

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BrokerList = []string{"localhost:9092"}
	Topic      = "jhd-test"
)

Functions

func AsyncProduce

func AsyncProduce()

AsyncProduce 异步生产消息

func ProtobufProduce

func ProtobufProduce()

ProtobufProduce 通过Protobuf序列化生产消息

func SyncProduce

func SyncProduce()

SyncProduce 同步生产消息

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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