MQ
文章平均质量分 84
曹朋羽
学无止境
展开
-
rabbitmq内置交换机消息发送接收例子
准备创建一个工具类,用来建立连接,定义队列名import com.rabbitmq.client.Connection;import com.rabbitmq.client.ConnectionFactory;public class RabbitUtil { public static String HELLO_QUEUE = "helloworld"; public static String WORK_QUEUE = "workqueue"; public static Strin原创 2021-04-08 21:21:43 · 547 阅读 · 0 评论 -
rabbitmq消息发送接收确认
建立连接import com.rabbitmq.client.Channel;import com.rabbitmq.client.Connection;import com.rabbitmq.client.ConnectionFactory;ConnectionFactory factory = new ConnectionFactory();factory.setHost("127.0.0.1");factory.setPort(5672);factory.setUsername("gu原创 2021-04-07 20:50:18 · 657 阅读 · 0 评论 -
rabbitmq exchange(交换机)
内置交换机类型Fanoutfanout英文是扇形,分裂的意思。将接受到的消息广播到所有已知队列。Directa message goes to the queues whose binding key exactly matches the routing key of the message.直接模式,比fanout模式更精确。只有队列的绑定的routingKey和消息publish的时候一致,exchange才会将该消息投递到此队列。fanout类型的交换机routingKey参数就没原创 2021-04-05 14:34:28 · 279 阅读 · 0 评论 -
rabbitmq安装配置
安装采用下载安装包手动安装的方式。两个依赖包erlang和socat。rpm包各版本下载发布地址:https://github.com/rabbitmq/rabbitmq-server/releaseswget www.rabbitmq.com/releases/erlang/erlang-18.3-1.el7.centos.x86_64.rpmwget http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.r原创 2021-04-04 18:29:45 · 150 阅读 · 0 评论