当前位置:网站首页>Foundation of ActiveMQ
Foundation of ActiveMQ
2022-07-03 19:01:00 【LAN Jiao Yu wenle】
One 、 install
Portal :ActiveMQ
And JDK Corresponding version , Otherwise, an error will be reported
ActiveMQ The correct startup of requires installation jdk
jdk Installation documentation for :
linux install jdk8_ Last d Light language blog -CSDN Blog _linux install jdk
Unpack the command :tar -zxvf apache-activemq-5.16.5-bin.tar.gz
Get into bin Catalog : cd apache-activemq-5.16.5/bin/
start-up ActiveMQ : ./activemq start
Launch success screen :
activemq The default port number is :61616 , The port number for external access is :ip:8161/admin/
account number :admin
password :admin
cannot access activemq Console solution :
Attention to detail : Need to restart activemq
Click on Queues You can view the message queue
Two 、SpringBoot Integrate ActiveMQ test
① Import dependence , The downloaded version will be introduced into that version
<!-- activemq rely on -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
② The configuration file
server:
port: 8001
spring:
application:
name: activemq
activemq:
broker-url: tcp://xxx.xxx.xxx.xxx:61616
user: admin
password: admin
jms:
pub-sub-domain: false # Configure whether it is in publish subscribe mode , Default false For point-to-point mode
③ Point to point mode
Generator message sending :
Consumer message acceptance :
// Inject IOC Containers
@Component
public class ActivemqListener {
// Set up queue Destination , Same as the previously configured destinationName bring into correspondence with
@JmsListener(destination = "test-queue")
public void receiveMsg(Message message) throws JMSException {
// Because the message we send is of string type , So here we judge and filter the types
if(message instanceof TextMessage){
// Forced to TextMessage
TextMessage textMessage = (TextMessage) message;
System.out.println(textMessage.getText());
}
}
}
Last , Start the startup class , That is, you can send it point-to-point , Receive messages sent by producers !
④ Publish subscribe
Modify the configuration
producer
consumer
Because this is a release - A subscription model , So we must first run consumers , After the consumer successfully starts , Restart producer
边栏推荐
- EGO Planner代码解析bspline_optimizer部分(3)
- leetcode:556. 下一个更大元素 III【模拟 + 尽可能少变更】
- leetcode:556. Next larger element III [simulation + change as little as possible]
- Torch learning notes (6) -- logistic regression model (self training)
- Zhengda futures news: soaring oil prices may continue to push up global inflation
- 利用可视化结果,点击出现对应的句子
- Torch learning notes (2) -- 11 common operation modes of tensor
- SSM整合-前后台协议联调(列表功能、添加功能、添加功能状态处理、修改功能、删除功能)
- [new year job hopping season] test the technical summary of interviewers' favorite questions (with video tutorials and interview questions)
- Work Measurement - 1
猜你喜欢
PyTorch中在反向传播前为什么要手动将梯度清零?
记录在模拟器中运行flutter时报的错
Ctrip will implement a 3+2 work system in March, with 3 days on duty and 2 days at home every week
leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*
Recommend a simple browser tab
Analysis of dart JSON encoder and decoder
Driveseg: dynamic driving scene segmentation data set
ActiveMQ的基础
平淡的生活里除了有扎破皮肤的刺,还有那些原本让你魂牵梦绕的诗与远方
随机推荐
Boost.Asio Library
235. 二叉搜索树的最近公共祖先【lca模板 + 找路径相同】
虚拟机和开发板互Ping问题
leetcode:556. 下一个更大元素 III【模拟 + 尽可能少变更】
Record the errors reported when running fluent in the simulator
[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]
Which do MySQL and Oracle learn?
What does a really excellent CTO look like in my eyes
ActiveMQ的基础
Hard disk monitoring and analysis tool: smartctl
SSM integration - joint debugging of front and rear protocols (list function, add function, add function status processing, modify function, delete function)
Implementation of cqrs architecture mode under Kratos microservice framework
KINGS
Simple solution of physical backup and restore of Damon database
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Torch learning notes (6) -- logistic regression model (self training)
leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
Integrated easy to pay secondary domain name distribution system
Kratos微服务框架下实现CQRS架构模式
[Yu Yue education] world reference materials of Microbiology in Shanghai Jiaotong University