rocketmq

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package rocketmq is a very basic (and incomplete) implementation of RocketMQ remoting protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMqRemotingMessage

func CreateMqRemotingMessage(payload string, code int, version int) []byte

Creates a RocketMQ remoting message. Format described here: https://github.com/apache/rocketmq/blob/bd0e9c09db9748f7f74a0c707579142dccf30afc/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java#L473

[4 byte total length] [4 byte header length] (includes protocol type flag) [n bytes header data] [n bytes body data]

The code can be found here: https://github.com/apache/rocketmq/blob/c78061bf6ca5f35452510ec4107c46735c51c316/test/src/test/resources/schema/protocol/common.protocol.RequestCode.schema

This can return 'nil' if the requested payload is too large or marshalling the json header fails.

func ReadMqRemotingResponse

func ReadMqRemotingResponse(conn net.Conn) ([]byte, []byte, bool)

Reads a remoting message from the remote target.

Types

This section is empty.

Jump to

Keyboard shortcuts

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