Coder Social home page Coder Social logo

rabbitmqdemo's Introduction

RabbitMQDemo

rabbitMQ消息服务管理,生产者消费者一些模式开发,测试的 docker容器运行项目

SpringBootRabbitMQMany 多个消息的发送和接收者

SpringBootRabbitMQ 单个消费者和生产者

先熟悉下面会用到的一些名词~

exchange: 交换机

routingkey: 路由key

queue: 队列

exchange和queue是需要绑定在一起的,然后消息发送到exchange再由exchange通过routingkey发送到对应的队列中。

exchange分四种

Default Exchange 这种是特殊的Direct Exchange,是rabbitmq内部默认的一个交换机。该交换机的name是空字符串,所有queue都默认binding 到该交换机上。所有binding到该交换机上的queue,routing-key都和queue的name一样。

注意: 这就是为什么你直接创建一个queue也能正常的生产与消费,因为对应的exchange是RabbitMQ默认的,routingkey就是该队列的名字

Topic Exchange 通配符交换机,exchange会把消息发送到一个或者多个满足通配符规则的routing-key的queue。其中表号匹配一个word,#匹配多个word和路径,路径之间通过.隔开。如满足a..c的routing-key有a.hello.c;满足#.hello的routing-key有a.b.c.helo。

Fanout Exchange 扇形交换机,该交换机会把消息发送到所有binding到该交换机上的queue。这种是publisher/subcribe模式。用来做广播最好。 所有该exchagne上指定的routing-key都会被ignore掉。

Header Exchange 设置header attribute参数类型的交换机。

简单的了解之后,下面就是延迟队列的实现方式

延迟队列的实现 延迟分两种

在msg上设置过期时间 在队列上设置过期时间

testdocker 这个项目是测试容器服务时候用的, springboot项目,然后在pom.xml文件依赖docker 直接用maven打包到相对应的服务器中,服务器必须先安装docker部署环境

rabbitmqdemo's People

Contributors

huyang168 avatar

Watchers

James Cloos avatar

Forkers

yinyanlun

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.