安装

http://activemq.apache.org/artemis/download.html

创建broker

将artemis解压完成后,在重新建一个文件夹artmisbroker

运行
artemis.cmd create C:\artmisbroker --user mq --password 123
即可在artmisbroker目录下生成所需的文件 运行artemis
"C:\artmisbroker\bin\artemis" run 使用Windows service方式运行artemis
"C:\artmisbroker\bin\artemis-service.exe" install
"C:\artmisbroker\bin\artemis-service.exe" start 停止 windows service:
"C:\artmisbroker\bin\artemis-service.exe" stop 卸载windows service
"C:\artmisbroker\bin\artemis-service.exe" uninstall 访问 http://localhost:8161/console 进入监视界面

在springboot中的使用

依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-artemis</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>

配置

spring.artemis.mode=native
spring.artemis.host=localhost
spring.artemis.port=61616
spring.artemis.user=mq
spring.artemis.password=123

Producer

@Component
public class Producer { @Autowired
private JmsMessagingTemplate jmsMessagingTemplate; public void send(Destination destination, final String message) {
jmsMessagingTemplate.convertAndSend(destination, message + "from queue");
} @JmsListener(destination="out.queue")
public void consumerMessage(String text){
System.out.println("从out.queue队列收到的回复信息为:"+text);
}
}

Consumer

@Component
public class Consumer {
@JmsListener(destination = "mytest.queue")
@SendTo("out.queue")
public String receiveQueue(String text) {
System.out.println("Consumer收到的信息为:"+text);
return "return message "+text;
}
}

Rest使用

@ResponseBody
@RequestMapping(value = "/mqtest", method = RequestMethod.GET)
public Object mqtest() {
Destination destination = new ActiveMQQueue("mytest.queue");
producer.send(destination, "I am YeJiaWei");
return "OK";
}

activemq artemis安装运行及其在springboot中的使用的更多相关文章

  1. activemq安装运行及其在springboot中的queue和topic使用

    安装activemq 运行 springboot使用 依赖 配置 Producer Consumer ComsumerTopic 使用 安装activemq http://activemq.apach ...

  2. ActiveMQ 的安装与使用(springboot版本)

    一.安装 上官网下载tar包 http://activemq.apache.org/ tar -zxvf 后进入bin/linux-86-64 ./activimq start 启动 二.使用 pom ...

  3. 以ActiveMQ为例JAVA消息中间件学习【3】——SpringBoot中使用ActiveMQ

    前言 首先我们在java环境中使用了ActiveMQ,然后我们又在Spring中使用了ActiveMQ 本来这样已经可以了,但是最近SpringBoot也来了.所以在其中也需要使用试试. 可以提前透露 ...

  4. (二)Redis在Mac下的安装与SpringBoot中的配置

    1 下载Redis 官网下载,下载 stable 版本,稳定版本. 2 本地安装 解压:tar zxvf redis-6.0.1.tar.gz 移动到: sudo mv redis-6.0.1 /us ...

  5. Android中插件开发篇之----动态加载Activity(免安装运行程序)

    一.前言 又到周末了,时间过的很快,今天我们来看一下Android中插件开发篇的最后一篇文章的内容:动态加载Activity(免安装运行程序),在上一篇文章中说道了,如何动态加载资源(应用换肤原理解析 ...

  6. [转+补]Android打包so后魅族5中安装运行崩溃问题的解决方法

    上周在做噪音检测so集成中,遇到不同的so库打包到 APK 时,安装在某些机器上,出现 java.lang.UnsatisfiedLinkError 加载失败. 为此,深究了一下原理,和给出了解决方案 ...

  7. SpringBoot(四)SpringBoot中lombok使用

    lombok概述 lombok简介 Lombok想要解决了的是在我们实体Bean中大量的Getter/Setter方法,以及toString, hashCode等可能不会用到,但是某些时候仍然需要复写 ...

  8. springBoot中使用定时任务

    简单示例 导入依赖 springBoot已经默认集成了定时任务的依赖,只需要引入基本的依赖就可以使用定时任务. <parent> <groupId>org.springfram ...

  9. ActiveMQ 的安装与使用

    消息中间件简介 消息中间件(MOM:Message Orient middleware) 消息中间件有很多的用途和优点: 1. 将数据从一个应用程序传送到另一个应用程序,或者从软件的一个模块传送到另外 ...

随机推荐

  1. Selenium with Python 001 - 安装篇

    Selenium Python bindings 提供了一个简单的API,让你使用Selenium WebDriver来编写功能/校验测试. 通过Selenium Python的API,你可以非常直观 ...

  2. hdu2586倍增lca

    求距离 #include<map> #include<set> #include<cmath> #include<queue> #include< ...

  3. TCP和Http的区别!(转) 真心有帮助!!!

    一.From:http://thisliy.javaeye.com/blog/710122 http://wenku.baidu.com/view/14a30d0102020740be1e9b84.h ...

  4. 【Python】函数对象

    转:作者:Vamei 出处:http://www.cnblogs.com/vamei 函数也是一个对象,具有属性(可以使用dir()查询).作为对象,它还可以赋值给其它对象名,或者作为参数传递. la ...

  5. git clone 时显示Filename too long的解决办法

    在git bash中,运行下列命令: git config --global core.longpaths true 就可以解决该问题. --global是该参数的使用范围,如果只想对本版本库设置该参 ...

  6. Linux各文件及目录说明2018-03-01更新

    本人wechat:YWNlODAyMzU5MTEzMTQ=. *** /etc /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/clo ...

  7. AAC解码算法原理详解

  8. 第一章 Linux系统入门

    设定目标,寻求方法,勤奋努力,坚持不懈. ------你们知道了,而我们做到了.------ 世界上第一台计算机:ENIAC(埃尼亚克).1946-2 宾夕法尼亚大学. 约翰·冯·诺依曼体系 电脑的组 ...

  9. Linux fork exec等

    http://www.cnblogs.com/leoo2sk/archive/2009/12/11/talk-about-fork-in-linux.html http://www.cnblogs.c ...

  10. Qt图形视图体系结构示例解析(视图、拖拽、动画)

    本博的示例来自与QT Example:C:\Qt\Qt5.9.3\Examples\Qt-5.9.3\widgets\graphicsview\dragdroprobot 将通过分析示例完成主要功能: ...