activemq

Spring和Apache CXF,ActiveMQ整合记录

混江龙づ霸主 提交于 2019-11-27 17:52:07
Spring 3.2.8 Apache CXF 1.6 ActiveMQ 5.9.0 Tomcat 8.0.3 MyEclipse 2013 1. Spring 需要的 jar 包: spring-aop ( aop 支持) spring-beans (配置 spring bean 必须的包) spring-context (应用上下文支持,必须) spring-core ( spring 核心的包,包括 io 操作, cglib 等) spring-experssion (可能是 xml 解析相关的包,不要的话 XmlWebApplicationContext 无法启动) spring-jms ( jms 支持) spring-web (在 web 容器中启动) spring-tx (事务支持) 其中, spring-tx,spring-aop 不是必选,根据需要。 2. CXF 需要的 jar 包: cxf-api cxf-rt-bindings-soap cxf-rt-bindings-xml cxf-rt-core cxf-rt-databinding-jaxb cxf-rt-frontend-jaxws cxf-rt-frontend-simple cxf-rt-transports-http org-apache-servicemix-bundles-wsdl4j

How to activemq in ssl

左心房为你撑大大i 提交于 2019-11-27 16:36:53
问题 I'm trying to send messages via jms (activemq) but I want it to be in ssl protocol. It actuality works in tcp for now. I use jndi, with a virtual topic and 2 queues. Could somebody help me, I tryed this but I get stuck the server won't start : http://activemq.apache.org/how-do-i-use-ssl.html thx edit : The log says : "The reference to entity "needClientAuth" must end with the ';' delimiter." 回答1: I will answer my own question : First of all inside ..../apache-activemq-5.11.1/conf/activemq.xml

Activemq will not start on my Ubuntu VM

泪湿孤枕 提交于 2019-11-27 16:03:40
I'm trying to run activemq on my ubuntu virtual machine but have constantly been running into issues getting it to start up. I've tried downloading the binary and source with no luck. Currently I have downloaded the source, run "mvn clean install -Dmaven.test.skip=true" and mvn reported successful installation. I then hunted around in my .m2 folder found apache-activemq-5.5.1-bin.tar.gz and extracted it to my home/USERNAME dir and attempted to run "bash bin/activemq start" only to receive the following error. INFO: Loading '/etc/default/activemq' INFO: Using java '/usr/bin/java' INFO: Starting

SpringBoot2.0与ActiveMQ整合(三)

Deadly 提交于 2019-11-27 16:00:18
使用内嵌服务 1、在pom.xml文件中引入以下依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency> 2、在文件下创建Producter和Consumer: 3、生产者Producter中的代码如下: @RestController public class Producter { @Autowired private JmsMessagingTemplate jmsMessagingTemplate; @RequestMapping("/send") public void sendMessage(String text) { jmsMessagingTemplate.convertAndSend("xhy",text); } } 消费者Consumer代码如下: @Component public class Consumer { @JmsListener(destination = "xhy") public void receiveMessage(String text) { System.out.println("接收到消息"+text); } } 4、测试:启动服务后

Could not start 2 embedded active-mq on different ports within different spring boot applications

廉价感情. 提交于 2019-11-27 15:54:44
I have 2 spring-boot applications. Each application has embedded active mq broker. I need to have 2 applications working on the same PC in parallel but it doesn't work now. First application always starts successfully: 2018-02-02 11:48:20.095 INFO 7660 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@53045c6c: startup date [Fri Feb 02 11:48:20 MSK 2018]; root of context hierarchy 2018-02-02 11:48:20.923 INFO 7660 --- [ JMX connector] o.a.a.broker.jmx.ManagementContext : JMX consoles can connect to

天天都用消息队列,却不知道为啥要用MQ,这就有点尴尬了

被刻印的时光 ゝ 提交于 2019-11-27 13:05:31
  1、为什么要使用消息队列?   分析:一个用消息队列的人,不知道为啥用,有点尴尬。没有复习这点,很容易被问蒙,然后就开始胡扯了。   回答:这个问题,咱只答三个最主要的应用场景(不可否认还有其他的,但是只答三个主要的),即以下六个字:解耦、异步、削峰   (1)解耦   传统模式:      传统模式的缺点:   系统间耦合性太强,如上图所示,系统A在代码中直接调用系统B和系统C的代码,如果将来D系统接入,系统A还需要修改代码,过于麻烦!   中间件模式:      中间件模式的的优点:   将消息写入消息队列,需要消息的系统自己从消息队列中订阅,从而系统A不需要做任何修改。   (2)异步   传统模式:      传统模式的缺点:   一些非必要的业务逻辑以同步的方式运行,太耗费时间。   中间件模式:      中间件模式的的优点:   将消息写入消息队列,非必要的业务逻辑以异步的方式运行,加快响应速度   (3)削峰   传统模式      传统模式的缺点:   并发量大的时候,所有的请求直接怼到数据库,造成数据库连接异常   中间件模式:      中间件模式的的优点:   系统A慢慢的按照数据库能处理的并发量,从消息队列中慢慢拉取消息。在生产中,这个短暂的高峰期积压是允许的。   2、使用了消息队列会有什么缺点?   分析:一个使用了MQ的项目

Apache ActiveMQ browser can't connect to JMX console

独自空忆成欢 提交于 2019-11-27 13:03:52
问题 I am using Apache ActiveMQ version 5.8.0 and I downloaded Apache ActiveMQ Browser version 2.5.2.8 Within Apache ActiveMQ I edited the activemq.xml configuration to use JMX: <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" brokerName="localhost" dataDirectory="${activemq.data}"> <!-- This needed to be set to true, otherwise JMX won't start in 5.8.0 --> <managementContext> <managementContext createConnector="true"/> </managementContext> </broker> Within the startup script I

maven安装本地jar

不想你离开。 提交于 2019-11-27 12:52:03
一.修改setting.xml的配置为本地仓库地址 二.执行命令 mvn install:install-file "-Dfile=D:\Workspace-idea-SpringCloud\maven\my_local_repository\local\activemq-all-5.6.0.jar" "-DgroupId=activemq" "-DartifactId=activemq5.6.0" "-Dversion=5.6.0" "-Dpackaging=jar" 命令解释: (1).-Dfile=待安装的jar (2).-DgroupId, -DartifactId, -Dversion:三个参数,就是指明了存放maven仓库(路径“D:\Workspace-idea-SpringCloud\maven\my_local_repository”下)中的位置; (3).-Dpackaging :猜测就是指明文件类型 三.pom.xml <dependency> <groupId>activemq</groupId> <artifactId>activemq5.6.0</artifactId> <version>5.6.0</version></dependency> 来源: https://www.cnblogs.com/kongxc/p/11363775.html

ActiveMq-基础知识

独自空忆成欢 提交于 2019-11-27 11:02:46
一、简单介绍 1. 啥是中间件? 通俗的说,就是不是给用户直接使用,也不处理系统业务的一个中间服务。可以看作一个团队里的辅助,有了它可以增益全队,少了也没啥大事。 2. 为啥要用消息中间件? 场景一: 首先来说一个经典场景,商品秒杀。如0元秒杀10件商品,就可能有十万大佬在抢。同一时间这么大的访问压力,随随便便就把服务干宕机了。这时,就可以用中间件来缓存这些用户的请求,然后慢慢的处理消费掉。 场景二: 平常我们在转账或者取钱后,都会接收到短信通知。这里发送短信就是在处理完业务后,生成一个发送的消息丢到消息中间件中,等待消费异步处理 场景三: 经常看直播的小伙伴,都知道订阅自己喜欢的主播。一旦主播上线,就会通知到你,该去刷飞机火箭了~~~ 以上三个是比较经典的使用场景。简单的概括一下,使用消息中间件可以实现一下三点: 1.流量削峰减轻服务压力。 2.实现业务操作的解耦合,实现异步化。 3.发布订阅 3. 啥叫JMS? JMS即Java消息服务(Java Message Service的简称),是Java EE 的标准/规范之一。这种规范(标准)指出:消息的发送应该是异步的、非阻塞的。也就是说消息的发送者发送完消息后就直接返回了,不需要等待接收者返回后才能返回,发送者和接收者可以说是互不影响。所以这种规范(标准)能够减轻或消除系统瓶颈,实现系统之间去除耦合

ActiveMQ with C# and Apache NMS - Count messages in queue

笑着哭i 提交于 2019-11-27 07:21:02
问题 I'm using ActiveMQ to send and receive messages using a C# app. However I'm having some difficulty just getting a count of the messages in the queue.. Here's my code: public int GetMessageCount() { int messageCount = 0; Uri connecturi = new Uri(this.ActiveMQUri); IConnectionFactory factory = new NMSConnectionFactory(connecturi); using (IConnection connection = factory.CreateConnection()) using (ISession session = connection.CreateSession()) { IDestination requestDestination = SessionUtil