activemq

spring configuring embedded BrokerService

两盒软妹~` 提交于 2019-12-22 08:53:10
问题 i would like to configure embedded ActiveMQ broker service inside spring mvc application. Here is my configuration @Configuration @EnableJms public class JmsConfiguration { @Bean(initMethod = "start", destroyMethod = "stop") public BrokerService brokerService() throws Exception { BrokerService brokerService = new BrokerService(); brokerService.setPersistent(false); brokerService.setUseJmx(false); brokerService.addConnector("vm://localhost:0"); brokerService.setBrokerName("broker");

When should I close a JMS connection that was created in a stateless session bean?

╄→гoц情女王★ 提交于 2019-12-22 08:47:34
问题 I have a general question about when to close connections that have been created within a stateless session bean (EJB). The connections are to ActiveMQ and they are created within the bean's constructor. The connection is then used within a method, and I'm wondering when the appropriate time/place to close this connection is. Would it be appropriate to have a separate method for closing the connection, that must be called by the class using the bean? Or should I simply close the connection

ActiveMQ bridge connector to WebSphereMQ without using XML config

試著忘記壹切 提交于 2019-12-22 08:43:42
问题 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

Replay Messages sent over ActiveMQ

本小妞迷上赌 提交于 2019-12-22 06:28:41
问题 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. 回答1: There are easy ways to get started, if you have not too many

Priority with activemq

隐身守侯 提交于 2019-12-22 05:54:24
问题 We're currentyly developping an application using JMS and activemq (5.5.1). We would like to define a higher priority for some messages, which would make them consumed first. After setting the producer and the consumer (through spring (3.1) JMSTemplate), the priority does not fully work. Indeed, when we "turn off" the consumer, and send some messages, the priority is respected, but when we add messages while the consumer is on, the messages are received in the same order they were sent. The

Can't get ActiveMQ to resend my messages

不想你离开。 提交于 2019-12-22 04:43:08
问题 I have a single threaded ActiveMQ consumer written in Java. All I'm trying to do is receive() a messsage from the queue, attempt to send it to a web service, and if it succeeds acknowledge() it. If the web service call fails, I want the message to stay on the queue and be resent after some timeout. It's more or less working, except for the resending part: each time I restart my consumer, it gets one message for each that's still on the queue, but after failing to send them, the messages are

Can't get ActiveMQ to resend my messages

左心房为你撑大大i 提交于 2019-12-22 04:43:03
问题 I have a single threaded ActiveMQ consumer written in Java. All I'm trying to do is receive() a messsage from the queue, attempt to send it to a web service, and if it succeeds acknowledge() it. If the web service call fails, I want the message to stay on the queue and be resent after some timeout. It's more or less working, except for the resending part: each time I restart my consumer, it gets one message for each that's still on the queue, but after failing to send them, the messages are

springboot整合activemq发送消息

江枫思渺然 提交于 2019-12-22 04:42:42
1、启动activemq,并进入MQ的消息队列 2、在pom.xml中添加依赖包 < ! -- 整合activemq -- > < dependency > < groupId > org . springframework . boot < / groupId > < artifactId > spring - boot - starter - activemq < / artifactId > < / dependency > < dependency > < groupId > com . alibaba < / groupId > < artifactId > fastjson < / artifactId > < version > 1.2 .30 < / version > < / dependency > 3、创建全局配置文件(application.properties) spring . activemq . broker - url = tcp : / / localhost : 61616 spring . activemq . user = admin spring . activemq . password = admin spring . activemq . in - memory = true spring . activemq . pool .

WebSphere Liberty ActiveMQ

纵饮孤独 提交于 2019-12-21 21:17:23
问题 My goal is to consume Messages with the WebSphere Liberty Appserver (Full Java EE Standard) from an ActiveMQ. Unlucky I can't figure out how to configurate the WebSphere Liberty. The ActiveMQ Server im using is out of the box and I have added a Queue named myQueue. In my Java EE application I want to have a Message Driven Beans which gets kicked if a message is in the queue. I tried to "steal" the configuration from the wasDev JMS Example like someone else did on this example. But unlucky the

从零开始学 Java - Spring 集成 ActiveMQ 配置(二)

北城以北 提交于 2019-12-21 16:38:34
从上一篇开始说起 上一篇 从零开始学 Java - Spring 集成 ActiveMQ 配置(一) 文章中讲了我关于消息队列的思考过程,现在这一篇会讲到 ActivMQ 与 Spring 框架的整合配置,以及我们的多队列配置、断线重连机制,当然还有的生产者及消费监听者的具体代码实现。 ActiveMQ 是 Apache 出品,最流行的、能力强劲的开源消息总线。ActiveMQ 是一个完全支持 JMS1.1 和 J2EE 1.4 规范的 JMS Provider 实现,可以很容易内嵌到使用Spring的系统里面去,所以我们选择它。 一些基础的准备工作 先去官网下载服务器端的安装包,地址:http://activemq.apache.org/activemq-5130-release.html, 根据自己系统下来,并进行安装,这里不再赘述,安装完成后,一般可以打开一个这样的界面: 接着,找到我们需要的 jar 包。其实刚刚下载的文件中就有,我们只需要导入到我们的项目中即可,当然,你也可以从我的示例项目中获得:https://github.com/mafly/SpringDemo/blob/master/WebContent/WEB-INF/lib/ 开始写代码吧 一、建立 cn.mayongfa.activemq 包。 1.新建 MessageSender.java 消息发送类 /*