activemq

ActiveMQ - delete/purge all queue via command line

落花浮王杯 提交于 2019-12-05 16:42:56
问题 Is there a way to delete / purge all queues in ActiveMQ via the command line (win/linux)? I could only find the commands for a specific queue. Or maybe there's a way to do this via the activeMQ admin? Again, I only found how to delete/purge the queues one by one, which can be very tedious. Thanks! 回答1: You can do tweak your activemq.xml a bit: <broker deleteAllMessagesOnStartup="true" ...> This works with KahaDB message stores (it has problems with JDBC message stores), all your messages get

Syntax for selecting messages by Jms ID

心已入冬 提交于 2019-12-05 16:04:44
What is the correct syntax for selecting messages based on their corresponding JMS ID? Currently I use: String selector = "JMSMessageID='ID:305:1:5:1:1'"; messageConsumer = session.createConsumer(getRetryQueue(), selector); The above syntax works in test with a mocked broker. But towards ActiveMQ the messages are not polled. Original code: @Override public Message readMessageFromRetryQueueByJmsId(String jmsId) throws QueueingException { Connection connection = null; Session session = null; MessageConsumer messageConsumer = null; Message message = null; try { connection = getConnectionFactory()

ActiveMQ : Async error occurred: java.lang.OutO...

烈酒焚心 提交于 2019-12-05 15:19:48
参考-- http://activemq.apache.org/javalangoutofmemory.html 对于MQ的内容实用是可管理和可配置的。首先需要判断的是MQ的哪部分系统因内存不足而导致泄漏,是JVM,broker还是消费者、生产者? 一、内存管理 JVM内存管理: 1. 用bin/activemq命令在独立JVM中运行broker。用-Xmx和-Xss命令即可(activemq.bat文件中修改ACTIVEMQ_OPTS选项参数即可); 2. 默认情况下,MQ用512M的JVM; broker内存管理: 1. broker使用的内存并不是由JVM的内存决定的。虽然受到JVM的限制,但broker确实独立管理器内存; 2. systemUsage和destination的内存限制与broker内存息息相关; 3. MQ中内存的关系是:JVM->Broker->broker features; 4. 所有destination的内存总量不能超过broker的总内存; 消费者: 1. 由于消息大小可以配置,prefetch limit往往是导致内存溢出的主要原因; 2. 减少prefetch limit的大小,会减少消费者内存中存储的消息数量; 生产者: 1. 除非消息数量超过了broker资源的限制,否则生产者不会导致内存溢出; 2. 当内存溢出后

ActiveMQ bridge connector to WebSphereMQ without using XML config

烂漫一生 提交于 2019-12-05 15:13:59
I want to create a broker to broker connection between ActiveMQ and WebSphere MQ in an embedded broker. I know that exists the network connector in activemq to do that (broker-to-broker), but I don't know how to configure it to connect to WebSphere MQ. Doing a search in the web I found some different ways to do with XML configuration and I noticed that the XML tags used does not refer the network connector, but refers a <jmsBridgeConnectors> , so I do a research about this bridge connector by using java code but I wasn't able to find something that points me about how to do that. Is there an

浅谈消息队列及常见的消息中间件

佐手、 提交于 2019-12-05 14:52:40
浅谈消息队列及常见的消息中间件 前言 消息队列 已经逐渐成为企业应用系统 内部通信 的核心手段。它具有 低耦合 、 可靠投递 、 广播 、 流量控制 、 最终一致性 等一系列功能。 当前使用较多的 消息队列 有 RabbitMQ 、 RocketMQ 、 ActiveMQ 、 Kafka 、 ZeroMQ 、 MetaMQ 等,而部分 数据库 如 Redis 、 MySQL 以及 phxsql 也可实现消息队列的功能。 正文 1. 消息队列概述 消息队列 是指利用 高效可靠 的 消息传递机制 进行与平台无关的 数据交流 ,并基于 数据通信 来进行分布式系统的集成。 通过提供 消息传递 和 消息排队 模型,它可以在 分布式环境 下提供 应用解耦 、 弹性伸缩 、 冗余存储 、 流量削峰 、 异步通信 、 数据同步 等等功能,其作为 分布式系统架构 中的一个重要组件,有着举足轻重的地位。 2. 消息队列的特点 2.1. 采用异步处理模式 消息发送者 可以发送一个消息而无须等待响应。 消息发送者 将消息发送到一条 虚拟的通道 ( 主题 或 队列 )上, 消息接收者 则 订阅 或是 监听 该通道。一条信息可能最终转发给 一个或多个 消息接收者,这些接收者都无需对 消息发送者 做出 同步回应 。整个过程都是 异步的 。 2.2. 应用系统之间解耦合 主要体现在如下两点:

消息队列属性及常见消息队列介绍

寵の児 提交于 2019-12-05 13:42:54
什么是消息队列? 消息队列是在消息的传输过程中保存消息的容器,用于接收消息并以文件的方式存储,一个队列的消息可以同时被多个消息消费者消费。分布式消息服务DMS则是分布式的队列系统,消息队列中的消息分布存储,且每条消息存储多个副本,以实现高可用性,如下图所示。 一般来说,消息队列具有如下属性: 消息顺序 普通队列支持“分区有序”和“全局队列”两种模式,ActiveMQ队列和Kafka队列均为分区有序。 分区有序的队列通过分布式处理,支持更高的并发,但由于队列的分布式特性,DMS无法保证能够以接收消息的精确顺序进行消费。如果用户要求保持顺序,建议在每条消息中放置排序信息,以便在收到消息时对消息重新排序。 全局有序的队列对消息消费遵循先入先出规则(FIFO),适用于对消费顺序要求较高的场景。 至少一次传递 在极少数情况下,当用户接收或删除消息时,存储消息副本的服务器之一可能不可用。如果出现这种情况,则该不可用服务器上的消息副本将不会被删除,并且在接收消息时可能会再次获得该消息副本。 这被称为“至少一次传递”,因此,用户的应用程序应该设计为幂等的应用程序(即,如果应用程序多次处理同一条消息,则不得受到不利影响)。 消息较少时单次消费不能获取指定数量的消息 从消息队列中消费消息时,DMS每次从部分消息存储分区中读取消息返回消息给消费者,如果队列中的消息数比较少,则单次消费可能会少于指定条数

Spring Batch - Not all records are being processed from MQ retrieval

时间秒杀一切 提交于 2019-12-05 11:44:48
I am fairly new to Spring and Spring Batch, so feel free to ask any clarifying questions if you have any. I am seeing an issue with Spring Batch that I cannot recreate in our test or local environments. We have a daily job that connects to Websphere MQ via JMS and retrieves a set of records. This job uses the out-of-the-box JMS ItemReader. We implement our own ItemProcessor, but it doesn't do anything special other than logging. There are no filters or processing that should affect incoming records. The problem is that out of the 10,000+ daily records on MQ, only about 700 or so (the exact

Replay Messages sent over ActiveMQ

北战南征 提交于 2019-12-05 10:23:32
Is there an easy way to create a copy of every message sent over a queue, so that if needed, the user could browse the list of previously transmitted messages and replay them numerous times with the click of a button? I have program X that sends a message to a queue and program Y then reads it in. I would like to be able to replay a message that was previously sent without having to go back to program X and regenerate it again. There are easy ways to get started, if you have not too many messages or too many queues. First, you could setup copying of messages to a "copy queue". This has to be

ActiveMQ

别来无恙 提交于 2019-12-05 08:41:06
Apache ActiveMQ是 Apache软件基金会 所研发的开放源代码 消息中间件 ;由于ActiveMQ是一个纯 Java 程序,因此只需要 操作系统 支持 Java虚拟机 ,ActiveMQ便可执行 支持 Java消息服务 (JMS) 1.1 版本 Spring Framework 集群 (Clustering) 支持的 编程语言 包括: C 、 C++ 、 C# 、 Delphi 、 Erlang 、 Adobe Flash 、 Haskell 、 Java 、 JavaScript 、 Perl 、 PHP 、 Pike 、 Python 和 Ruby 协议支持包括:OpenWire、 REST 、STOMP、WS-Notification、MQTT、 XMPP 以及AMQP [1] 来源: https://www.cnblogs.com/hshy/p/11915788.html

Spring JMS Activemq - set dead letter queue-name (DLQ)

你说的曾经没有我的故事 提交于 2019-12-05 08:25:59
We have 3 different projects that are running on the same ACTIVEMQ broker. Currently there is a single "DLQ" queue, we would like to set the dlq for each web application like so: dlq_webapp1 dlq_webapp2 dlq_webapp3 This way we will have more control on the retry flow. how can we configure it to be like so? here are some of our messaging beans: <bean id="redeliveryConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="${activemq_url}" /> <property name="redeliveryPolicy" ref="redeliveryPolicy" /> <property name="nonBlockingRedelivery" value=