GithubHelp home page GithubHelp logo

icpd / rabbitmq Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 5.0 43 KB

Wrap RabbitMQ ( amqp091-go ) to enable automatic reconnection in case of disconnection. 针对 RabbitMQ(amqp091-go) 的封装,使其能够断线自动重连

Go 100.00%
amqp091-go channel connect rabbitmq reconnect

rabbitmq's Introduction

Interesting things start from viewing forks.

rabbitmq's People

Contributors

icpd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rabbitmq's Issues

添加判断conn是否为nil或者是否被关闭,如果是才重新建立连接

func (r *rabbitmqConn) tryConnect(config *amqp.Config) (err error) {

添加conn == nil || conn.isclose 判断
如果连接可用,就只重连channel

// channel 关闭时,连接可能没有关闭。但 reconnect 会重新建立新的连接,所以这里手动关闭一旧连接避免长连接资源占用

移除关闭连接的操作

conn移除without exchange

TODO:

  • conn对象移除withoutexchange
  • publish调用的时候判断opts without exchange
  • conn对象保存已申明的交换机,publish调用时判断有了就不再重复申明
  • #8
  • #9

以上修改后publish调用前可一不用单独去申明交换机了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.