rocketmq

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

RocketMQ Client Go

License TravisCI

The RocketMQ Client in pure go, the project is developing, there is no any guarantee in production environment. in next versions, we will do our best to improve reliability, stability, usability and performance. the API may be changed, and more features will be added. there are many works need to continue in this project, like unit test, integration test, stable test, new feature, optimization, documents, etc. so, any contribution is very welcome. if you want do something, please browse issue list and select one, or create a new issue.


Features

in 2.0.0-alpha1, support:

  • sending message in synchronous mode
  • sending message in oneway mode
  • consuming message using push model

How to use


Apache RocketMQ Community


Contact us


How to Contribute

Contributions are warmly welcome! Be it trivial cleanup, major new feature or other suggestion. Read this how to contribute guide for more details.


License

Apache License, Version 2.0 Copyright (C) Apache Software Foundation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRequestTimeout for request timeout error
	ErrRequestTimeout = errors.New("request timeout")

	ErrMQEmpty = errors.New("MessageQueue is nil")
	ErrOffset  = errors.New("offset < 0")
	ErrNumbers = errors.New("numbers < 0")
)

Functions

func CheckError

func CheckError(action string, err error)

Types

type Producer

type Producer interface {
	Start() error
	Shutdown() error
	SendSync(context.Context, *primitive.Message) (*primitive.SendResult, error)
	SendAsync(context.Context, func(context.Context, *primitive.SendResult, error), *primitive.Message) error
	SendOneWay(context.Context, *primitive.Message) error
}

func NewProducer

func NewProducer(opts ...producer.Option) (Producer, error)

type PullConsumer

type PullConsumer interface {
	Start() error
	Shutdown() error
	Pull(context.Context, string, consumer.MessageSelector, int) (*primitive.PullResult, error)
	PullFrom(context.Context, *primitive.MessageQueue, int64, int) (*primitive.PullResult, error)
	CurrentOffset(*primitive.MessageQueue) (int64, error)
	UpdateOffset(*primitive.MessageQueue, int64) error
	PersistOffset(context.Context) error
}

func NewPullConsumer

func NewPullConsumer(opts ...consumer.Option) (PullConsumer, error)

type PushConsumer

type PushConsumer interface {
	Start() error
	Shutdown() error
	Subscribe(topic string, selector consumer.MessageSelector,
		f func(context.Context, ...*primitive.MessageExt) (consumer.ConsumeResult, error)) error
	Unsubscribe(string) error
}

func NewPushConsumer

func NewPushConsumer(opts ...consumer.Option) (PushConsumer, error)

Directories

Path Synopsis
examples
consumer/retry/concurrent
* * use concurrent consumer model, when Subscribe function return consumer.ConsumeRetryLater, the message will be * send to rocketmq retry topic.
* * use concurrent consumer model, when Subscribe function return consumer.ConsumeRetryLater, the message will be * send to rocketmq retry topic.
consumer/retry/order
* * use orderly consumer model, when Subscribe function return consumer.SuspendCurrentQueueAMoment, it will be re-send to * local msg queue for later consume if msg.ReconsumeTimes < MaxReconsumeTimes, otherwise, it will be send to rocketmq * DLQ topic, we should manually resolve the msg.
* * use orderly consumer model, when Subscribe function return consumer.SuspendCurrentQueueAMoment, it will be re-send to * local msg queue for later consume if msg.ReconsumeTimes < MaxReconsumeTimes, otherwise, it will be send to rocketmq * DLQ topic, we should manually resolve the msg.
producer/acl
Package main implements a producer with user custom interceptor.
Package main implements a producer with user custom interceptor.
producer/interceptor
Package main implements a producer with user custom interceptor.
Package main implements a producer with user custom interceptor.
Package internal is a generated GoMock package.
Package internal is a generated GoMock package.
remote
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Define the ctx key and value type.
* Define the ctx key and value type.

Jump to

Keyboard shortcuts

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