5 Star 31 Fork 17

tym_hmm / rabbitmq-pool-go

2023-03-01 11:54
天蝎儿

#修复 routekey 中死信队列问题
#解决 topic 下因指定路由key后,无法分流消费
#建议规范:存在路由时,使用"." 分隔单词,避免泛型路由问题

最后提交信息为: 修复死信routekey问题
2023-01-09 02:56
天蝎儿

#增加生产者断线自动重连

最后提交信息为: 增加生产者自动重连
2022-11-19 00:52
天蝎儿

#修复已知问题

最后提交信息为: 修复已知for带来的问题
2022-03-12 20:54
天蝎儿

#增加自定义虚拟host 设置 默认为 /
instanceConsumePool = kelleyRabbimqPool.NewConsumePool()
//使用默认虚拟路径
err := instanceConsumePool.Connect("192.168.1.169", 5672, "admin", "admin")
//使用自定义虚拟路径
err:=instanceConsumePool.ConnectVirtualHost("192.168.1.169", 5672, "admin", "admin", "/testHost")

2022-02-12 15:05
天蝎儿

#增加默认交换机、队列、数据都持久化到磁盘

最后提交信息为: 增加默认数据都持久化到磁盘
2022-02-09 11:59
天蝎儿

#增加手动消息确认
#去除无用输出信息
&rabbitmq.ConsumeReceive{
#定义消费者事件
ExchangeName: "testChange31",//队列名称
ExchangeType: kelleyRabbimqPool.EXCHANGE_TYPE_DIRECT,
Route: "",
QueueName: "testQueue31",
IsTry:true,//是否重试
IsAutoAck: false, //是否自动确认消息
MaxReTry: 5,//最大重试次数
EventFail: func(code int, e error, data []byte) {
fmt.Printf("error:%s", e)
},
/***

  • 参数说明
  • @chancelai data []byte 接收的rabbitmq数据
  • @chancelai header map[string]interface{} 原rabbitmq header
  • @chancelai retryClient RabbitmqPool.RetryClientInterface 自定义重试数据接口,重试需return true 防止数据重复提交
    ***/
    EventSuccess: func(data []byte, header map[string]interface{},retryClient kelleyRabbimqPool.RetryClientInterface)bool {//如果返回true 则无需重试
    _ = retryClient.Ack()//确认消息
    fmt.Printf("data:%s\n", string(data))
    return true
    },
    }
最后提交信息为: 修改提示输出
2021-11-10 20:36
天蝎儿

#增加消费者回调事件中自定义重试
/***

  • 参数说明
  • @chancelai data []byte 接收的rabbitmq数据
  • @chancelai header map[string]interface{} 原rabbitmq header
  • @chancelai retryClient RabbitmqPool.RetryClientInterface 自定义重试数据接口,重试需return true 防止数据重复提交
    ***/
    EventSuccess: func(data []byte, header map[string]interface{},retryClient kelleyRabbimqPool.RetryClientInterface)bool {//如果返回true 则无需重试
    fmt.Printf("data:%s\n", string(data))
    return true
    },
2021-11-04 14:47
天蝎儿

增加消费者任务发送随机重试时间
精确到秒
instanceConsumePool.SetRandomRetryTime(min int64, max int64)

Go
1
https://gitee.com/tym_hmm/rabbitmq-pool-go.git
git@gitee.com:tym_hmm/rabbitmq-pool-go.git
tym_hmm
rabbitmq-pool-go
rabbitmq-pool-go

搜索帮助