msgqueue

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package msgqueue 从消息队列服务收发消息

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartQcpConsume

func StartQcpConsume(conf *config.Config) (err error)

Types

type NATSConsumer

type NATSConsumer struct {
	CallBack func(msg *nats.Msg) //处理消息的回调函数
	// contains filtered or unexported fields
}

func (*NATSConsumer) Connect

func (n *NATSConsumer) Connect() (nc *nats.Conn, err error)

func (*NATSConsumer) Consume

func (n *NATSConsumer) Consume(nc *nats.Conn) (err error)

func (*NATSConsumer) Reply

func (n *NATSConsumer) Reply(nc *nats.Conn) error

type NATSProducer

type NATSProducer struct {
	ServerUrls string //消息队列服务地址,多个用","分割  例如 "nats://192.168.168.195:4222,nats://192.168.168.195:4223"

	Subject string //主题
}

func (*NATSProducer) Connect

func (n *NATSProducer) Connect() (nc *nats.Conn, err error)

func (*NATSProducer) Produce

func (n *NATSProducer) Produce(nc *nats.Conn, msg []byte) (err error)

func (*NATSProducer) ProduceWithReply

func (n *NATSProducer) ProduceWithReply(nc *nats.Conn, reply string, payload []byte) error

TODO

type QcpConsumer

type QcpConsumer struct {
	NATSConsumer
}

Jump to

Keyboard shortcuts

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