Registry / messaging / apache-rocketmq-client-go-v2

apache-rocketmq-client-go-v2

JSON →
library2.1.2gogounverified

Package rocketmq provides a Go client for Apache RocketMQ messaging system.

go get github.com/apache/rocketmq-client-go/v2
INSTALL
IMPORT
SIG · APACHE-ROCKETMQ-CL
A
apache-rocketmq-client-go-v2
messaginggov2.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rocketmq
github.com/apache/rocketmq-client-go/v2

Send a synchronous message to RocketMQ.

package main import ( "context" "fmt" "os" "github.com/apache/rocketmq-client-go/v2" "github.com/apache/rocketmq-client-go/v2/primitive" ) func main() { producer, err := rocketmq.NewProducer( rocketmq.WithNameServer([]string{"127.0.0.1:9876"}), ) if err != nil { fmt.Printf("NewProducer error: %s\n", err) os.Exit(1) } err = producer.Start() if err != nil { fmt.Printf("Start producer error: %s\n", err) os.Exit(1) } defer producer.Shutdown() msg := &primitive.Message{ Topic: "test", Body: []byte("Hello RocketMQ"), } res, err := producer.SendSync(context.Background(), msg) if err != nil { fmt.Printf("Send message error: %s\n", err) os.Exit(1) } fmt.Printf("Send result: %s\n", res.String()) }
Debug
Known issues
breakingThe v2 API is significantly different from v1; import path includes /v2.
fix
Use import path github.com/apache/rocketmq-client-go/v2.
affects: >=2.0.0
Upgrade
Version history
2.1.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
apache-rocketmq-client-go-v2 — go get apache-rocketmq-client-go-v2 · libregistry