activemq

Can topic messages be made persistent in activemq?

こ雲淡風輕ζ 提交于 2020-01-13 02:48:06
问题 I am very new to JMS and ESB. I am using activemq as JMS and mule as ESB. When i am forwarding the messages from one queue to another with jms connector parameter "persistentDelivery" as "true" it retains the messages in the target queue after activemq re-start. But in case of forwarding messages from one topic to another,the messages are not retained in the target topic after restart. Is there any limitation for persistence of messages in case of topic in activemq? Thanks in advance. Regards

Unit testing with JMS (ActiveMQ)

梦想与她 提交于 2020-01-12 14:05:43
问题 How to do unit testing with JMS ? Is it some de-facto for this ? I googled something - Unit testing for JMS: http://activemq.apache.org/how-to-unit-test-jms-code.html - jmsTemplate: activemq.apache.org/jmstemplate-gotchas.html - mockRunner : mockrunner.sourceforge.net/ Do you have any good experience on those and suggestion for me ? 回答1: In my experience (after trying to do the same thing) when you are using JMS you are doing something like 1) Get JMS Message 2) Extract Object from Message 3)

ActiveMQ笔记42-SpringBoot整合ActiveMQ之主题生产者

纵然是瞬间 提交于 2020-01-12 09:12:04
新建maven工程,我的工程名叫SpringBootActiveMQTopicProducer。 pom.xml,application.yml参考这篇博客: https://blog.csdn.net/qq_36059561/article/details/103834916 注意需要修改的一个地方,在application.yml中spring.jms.pub-sub-domain的值要设置成true,表示topic,下面的myqueue: boot-activemq-queue改成mytopic: boot-activemq-topic。 创建ConfigBean.java,编写代码,代码如下。 package com.wsy.boot.activemq.config; import org.apache.activemq.command.ActiveMQTopic; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.jms.annotation.EnableJms; import org.springframework.stereotype

Camel ActiveMQ + Spring boot not reading spring activemq configurations

橙三吉。 提交于 2020-01-11 05:19:09
问题 I am trying a very simple route with Spring Boot 1.5.2.RELEASE + Camel (Spring Boot Starter) + ActiveMQ, which is to read from a particular queue and then log it. However, it looks like it is not picking up my spring.activemq configuration for URL as I see in the log it is trying to connect to a different url and it continues to connect it and the my spring boot app never starts. The questions are based on my configuration that I am providing below how can I do the below: Fix the

ActiveMQ入门,ActiveMQ与RocketMQ的对比

≡放荡痞女 提交于 2020-01-09 20:15:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1. ActiveMQ入门 前面的文章已经写过MQ的相关概念,这里不再赘述。 1.1 ActiveMQ是什么 ActiveMQ是Apache下的开源项目,完全支持JMS1.1和J2EE1.4规范的JMS Provider实现。 1.2 ActiveMQ的特点 支持多种语言编写客户端 对Spring的支持,很容易和Spring整合 支持多种传输协议:TCP,SSL,NIO,UDP等 支持Ajax请求 1.3 ActiveMQ的安装 1.3.1 官网下载 http://activemq.apache.org/ 解压后的文件夹结构: 1.3.2 启动ActiveMQ 直接双击这个“wrapper.exe”即可 之后可以在浏览器输入 http://localhost:8161/ 1.3.3 进入管理中心 点击Manage ActiveMQ broker,会弹出身份验证,输入admin,admin即可 1.4 搭建Maven工程框架 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache

activeMQ支持的四种协议简介及性能比较

≯℡__Kan透↙ 提交于 2020-01-09 18:15:36
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> activeMQ5.11.1版本带的例子提供了四种协议的简单demo,这四种协议分别为:AMQP,MQTT,OpenWire,Stomp,通过运行这四种协议的的demo可以大致得出这四种协议实现在activeMQ中的性能对比: amqp Received 10001 in 6.58 seconds mqtt Received 10000 in 2.69 seconds openwire Received 10001 in 8.87 seconds stomp Received 10001 in 14.17 seconds 可以看出,mqtt协议的实现最快,stomp的协议实现最慢。 附这四种协议的简单介绍: AMQP协议: 即Advanced Message Queuing Protocol,一个提供统一消息服务的应用层标准高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计。基于此协议的客户端与消息中间件可传递消息,并不受客户端/中间件不同产品,不同开发语言等条件的限制。 MQTT协议: MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,有可能成为物联网的重要组成部分。该协议支持所有平台

MQTT-emqx,activemq

让人想犯罪 __ 提交于 2020-01-09 17:28:37
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一,win10下安装EMQ 1,下载解压(链接 https://www.emqx.io/downloads ) 2,将压缩包放在D,F根目录下进行解压,进入bin下, 执行emqx start, emqx.status, emqx stop, emqx uninstall; 3,浏览器地址 http://127.0.0.1:18083 , 用户名密码admin/public 来源: oschina 链接: https://my.oschina.net/u/3290532/blog/3155439

Which is better: PooledConnectionFactory or CachingConnectionFactory?

。_饼干妹妹 提交于 2020-01-09 12:17:47
问题 We use Spring (3.2.4) with ActiveMQ (5.8.0) in Tomcat (7.0.41) and it is not clear what the best usage. We want to use JmsTemplate to produce and MessageListenerContainer to receive messages. Should we use caching in receiver side? (related link) Works CachingConnectionFactory with ActiveMQ and failover? (related link) Need to set useAsyncSend="true" when we use PooledConnectionFactory? (related link) 回答1: From here: The difference between the PooledConnectionFactory and the

消息中间件之ActiveMQ

旧街凉风 提交于 2020-01-08 13:51:42
什么是消息中间件? 消息中间件是利用高效可靠的消息传递机制进行平台无关的数据交流,并基于数据 通信来进行分布式系统的集成。通过提供消息传递和消息排队模型,可以在分布式架构下扩展进程之间的通信。 消息中间件能做什么? 消息中间件主要解决的就是分布式系统之间消息传递的问题,它能够屏蔽各种平台以及协议之间的特性,实现引用程序之间的协同。举个非常简单的例子,就拿一个电商平台的注册功能来简单分析下,用户注册这一个服务,不单单只是insert一条数据到数据库里面就完事了,还需要发送激活邮件、发送新人红包或者积分、发送营销短信等一系列操作。假如说这里面的每一个操作,都需要消耗1s,那么整个注册过程就需要耗时4s才能响应给用户。 但是我们从注册这个服务可以看到,每一个子操作都是相对独立的,同时,基于领域划分以后,发送激活邮件、发送营销短信、赠送积分及红包都属于不同的子域。所以我们可以对这些子操作进行来实现异步化执行,类似于多线程并行处理的概念。如何实现异步化呢?用多线程能实现吗?多线程当然可以实现,只是,消息的持久化、消息的重发这些条件,多线程并不能满足。所以需要借助一些开源中间件来解决。而分布式消息队列就是一个非常好的解决办法,引入分布式消息队列以后,架构图就变成这样了(下图是异步消息队列的场景)。通过引入分布式队列,就能够大大提升程序的处理效率,并且还解决了各个模块之间的耦合问题

ActiveMQ学习之消息持久化概念

一世执手 提交于 2020-01-07 17:56:43
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、消息三大属性: 1、消息头 2、消息体 3、消息属性 二、消息类型 1、TextMessage 2、MapMessage 3、ObjectMessage 4、BytesMessage 5、StreamMessage 三、消息持久化 一、参数说明 1、非持久化 messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); 非持久化,当mq宕机后消息不存在 2、持久化(消息默认是持久化) messageProducer.setDeliveryMode(DeliveryMode.PERSISTENT); 持久化,当mq宕机后消息存在 二、持久化消息 1、非持久化队列 生产者 import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; /** * @ProjectName: springbootActiveMQ * @Package: cn.**.test * @Author: huat * @Date: 2020/1/2 17:04 * @Version: 1.0 */ public class ActiveMQTest { //url路径 private