activemq

How to pause and start consuming message using @JmsListener

谁都会走 提交于 2019-12-19 12:12:34
问题 I am using spring boot version 1.3.2. I am using @JmsListener to consume message from activemq for the message that I created/produced using JmsTemplate. Here is the code: @JmsListener(destination = "myqueue") public void consumeMsg(Object requestBody) try { javaMailSender.send(requestBody); } catch (MailException ex) { LOG.error(ex.getLocalizedMessage(), ex); if(ex.getMessage().contains(SMTP_CONNECTION_FAILURE) && activeMqMsg.getIntProperty("RETRYCOUNT") == 1) { producer.send("myqueue"

HTTP Post From ActiveMQ using Camel

淺唱寂寞╮ 提交于 2019-12-19 08:54:50
问题 We're using camel routes to post values from a queue to an http endpoint. I've successfully set up the route using camel's http component, but I'm unable to get the body of the jms message to post. For example, my route is set up like this: <route errorHandlerRef="dlc" autoStartup="true" id="route2" xmlns:ns2="http://camel.apache.org/schema/web" xmlns="http://camel.apache.org/schema/spring"> <from uri="activemq:test"/> <setHeader headerName="CamelHttpMethod"> <constant>POST</constant> <

Unable to shutdown embedded activeMQ service using the built in BrokerService.stop call

一曲冷凌霜 提交于 2019-12-19 06:03:24
问题 I have been using an embedded activeMQ server configuration (configuration is very similar to the examples that illustrate the concept of an embedded activeMQ server/listener). Aas part of the application, I have a monitoring thread that monitors a directory. Instead of having to kill the process to shutdown the activeMQ server, I introduced a check for a "STOP" file and if the file exists, the server would shutdown. The shutdown I am trying to accomplish by calling the stop function on the

How to send Jms message from one spring-boot application to another when both apps use embedded activemq

余生长醉 提交于 2019-12-19 03:45:35
问题 I have two spring-boot applications. in receiver-application's Application.java I have: @Bean public JmsListenerContainerFactory<?> myFactory(ConnectionFactory connectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) { DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); configurer.configure(factory, connectionFactory); return factory; } and in Receiver.java ... @JmsListener(destination = "myQueue", containerFactory = "myFactory") public

Unable to bind to a port on Openshift

久未见 提交于 2019-12-19 03:41:27
问题 I am running an embedded activemq message server in my application on openshift. According to this, you can only bind on 15000 - 35530 . I've tried doing the following, but it's throwing a serious error. What could be the issue? I am using spring . This is a part in my applicationContext.xml <amq:broker brokerName="tentacle-broker" start="true"> <amq:persistenceAdapter> <amq:amqPersistenceAdapter directory="/var/lib/openshift/username/jbossews-2.0/jbossews-2.0/activemq2" maxFileLength="32mb"/

Unable to bind to a port on Openshift

ε祈祈猫儿з 提交于 2019-12-19 03:41:23
问题 I am running an embedded activemq message server in my application on openshift. According to this, you can only bind on 15000 - 35530 . I've tried doing the following, but it's throwing a serious error. What could be the issue? I am using spring . This is a part in my applicationContext.xml <amq:broker brokerName="tentacle-broker" start="true"> <amq:persistenceAdapter> <amq:amqPersistenceAdapter directory="/var/lib/openshift/username/jbossews-2.0/jbossews-2.0/activemq2" maxFileLength="32mb"/

ActiveMQ delete queue from java

有些话、适合烂在心里 提交于 2019-12-19 03:25:33
问题 How could I delete a queue in activemq from java program? Is there anything like session.delelteQueue()? Thanks M. 回答1: Simple solution that does not use JMX it to cast connection to ActiveMQConnection and use its destroyDestination() method. Simple utility that uses that approach: import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQQueue; import javax.jms.JMSException; /** * simple class to delete a

Using ActiveMQ via JNDI

一个人想着一个人 提交于 2019-12-18 16:49:51
问题 I'm trying to create simply connect with ActiveMQ using JNDI. I have Queue named 'example.A'. According ActiveMQ documentation touching JNDI, if I want to use ConectionFactories and Queues (Topics) via JNDI, I have to place jndi.properties file on my classpath. As I have understood, activeMQ classpath is %activemq%/conf directory by default. I have not changed it. So I have this property for my queue: queue.MyQueue = example.A I have created java client class for ActiveMQ which uses JNDI as

How to monitor Apache Artemis

倾然丶 夕夏残阳落幕 提交于 2019-12-18 12:07:17
问题 I'm doing some testing with RabbitMQ, ActiveMQ and Apache Artemis in a Windows .NET environment. RabbitMQ and ActiveMQ ship with a web interface where you can see information about your broker, queues, messages etc. but Artemis does not. I really want to be able to monitor my Artemis broker in a web interface or at the very least with some cmd/PowerShell commands. I've read on this page about some third-party tools that can be used to monitor an ActiveMQ instance and I assumed that it also

ActiveMQ Consumer Hangs

爱⌒轻易说出口 提交于 2019-12-18 12:02:41
问题 I have an activeMQ broker using an SSL transport. I have about 10 consumers that are using the broker. I am using camel to configure my routes. Every so often, it hangs up and will not consume new messages, even if I restart the consumers, even though there are messages pending in the queues. I started trying to isolate where this was happening by stepping through my consumers one at a time trying to replicate the problem. I finally got to a consumer that I could re-create the problem on. It