mgrabbit

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 10 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MGin rabbitmq注册插件

安装

go get -u github.com/maczh/mgrabbit

使用

在MGin微服务模块的main.go中,在mgin.Init()之后,加入一行

	//加载RabbitMQ消息队列
	mgin.MGin.Use("rabbitmq",mgrabbit.Rabbit.Init,mgrabbit.Rabbit.Close,nil)

yml配置

在MGin微服务模块本地配置文件中
go:
  config:
    used: rabbitmq
    prefix:
      rabbitmq: rabbitmq-example
配置中心的rabbitmq-example-test.yml配置
go:
  rabbitmq:
    uri: amqp://test:********@xxx.xxx.xxx.xxx:5672/%2ftest
    exchange: e1 
配置中心的rabbitmq-example-test.yml多连接配置
go:
  rabbitmq:
    multi: true
    conns: c1,c2
    c1:
      uri: amqp://test1:********@xxx.xxx.xxx.xxx:5672/%2ftest1
      exchange: e1 
    c2:
      uri: amqp://test2:********@xxx.xxx.xxx.xxx:5672/%2ftest2
      exchange: e2 

变更记录

  • v0.0.4 多连接优化处理
  • v0.0.3 多连接支持

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Rabbit = &rabbitmq{}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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