activemq

delay delivery of message in activeMQ in spring boot

妖精的绣舞 提交于 2019-12-25 18:48:18
问题 I want to send a message at any time 't' that will be received by the receiver after 'x' sec. for doing so, I have written sender code @Autowired private JmsTemplate jmsTemplate; private Queue queue = new ActiveMQQueue("topicName"); public void show(String message) { try { System.out.println("Sending message " + message); jmsTemplate.convertAndSend(queue, message, new MessagePostProcessor() { @Override public Message postProcessMessage(Message message) throws JMSException { System.out.println

SpringBoot整合ActiveMQ

冷暖自知 提交于 2019-12-25 16:37:35
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 版本 spring-boot : 2.2.2 步骤 1.创建Maven项目 这里推荐spring提供的一个非常方便的建SpringBoot工程的网站:start.spring.io。打开如下页面: 如图所示填好你的groupId, artifactId,在Dependencies栏输入activemq即可搜索出相关依赖包,点击添加。 最后点击Generate生成工程项目。Gradle工程类似操作,这里不作细叙。 2.配置文件 在工程内的application.properties文件写入: spring.jms.pubSubDomain=false #默认false, 表示默认发送/监听的destination是queue,true则为topic spring.jms.jndiName= #连接工厂的jndi路径,如果你的mq连接是jndi提供才填 spring.jms.cache.enabled=true #是否使用session缓存,默认true spring.jms.cache.consumers=false #是否缓存消费者消息,默认false spring.jms.cache.producers=true #是否缓存消费者消息,默认true spring.jms.cache

ActiveMQ - Do I need to re-subscribe to a queue after the Listener event fires?

别说谁变了你拦得住时间么 提交于 2019-12-25 11:42:13
问题 I am integrating with an ActiveMQ JMS system using the Apache.NMS library. For the response queue listener, it's not clear whether the consumer is disposed after a message is received. Here are excerpts from the solution: var destination = getDestination(session, Settings.Instance.OutboundQueue); // Create a consumer and producer using (var consumer = session.CreateConsumer(destination)) { // Start the connection so that messages will be processed. connection.Start(); consumer.Listener +=

how to set jms message custom header using xpath in camel route

瘦欲@ 提交于 2019-12-25 11:25:59
问题 I am using camel route builder to move one activemq jms message from one queue to another by setting some custom header, by using xpath to read the node value from xml. nothing has been set. Please suggest if you know the answer. from("activemq:com.queue1") .setHeader("orderNumber").xpath("/orderRequest/authNumber") .to("activemq:com.queue2") .end(); XML would look like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:orderRequest xmlns:ns2="http://www.company.com/services/entity

How is ordering preserved in ActiveMQ?

折月煮酒 提交于 2019-12-25 10:02:18
问题 I have set up an application to listen to an ActiveMQ topic. Here's the way I have configured it: <jms:listener-container connection-factory="jmsFactory" container-type="default" destination-type="durableTopic" client-id="CMY-LISTENER" acknowledge="transacted"> <jms:listener destination="CMY.UPDATES" ref="continuingStudiesCourseUpdateListener" subscription="CMY-LISTENER" /> </jms:listener-container> <bean id="jmsFactoryDelegate" class="org.apache.activemq.ActiveMQConnectionFactory"> <property

How is ordering preserved in ActiveMQ?

淺唱寂寞╮ 提交于 2019-12-25 10:02:00
问题 I have set up an application to listen to an ActiveMQ topic. Here's the way I have configured it: <jms:listener-container connection-factory="jmsFactory" container-type="default" destination-type="durableTopic" client-id="CMY-LISTENER" acknowledge="transacted"> <jms:listener destination="CMY.UPDATES" ref="continuingStudiesCourseUpdateListener" subscription="CMY-LISTENER" /> </jms:listener-container> <bean id="jmsFactoryDelegate" class="org.apache.activemq.ActiveMQConnectionFactory"> <property

ActiveMQ: consumer / producer implement different protocols for the same queue?

旧城冷巷雨未停 提交于 2019-12-25 09:33:34
问题 I am getting into Message Queueing recently (with ActiveMQ) and experimenting. So far I have been able to set up one producer with 2 consumers written in Java implementing JMS over Tcp. The producer sends 2 types of messages to the queue in ActiveMQ, while at the other end, 2 consumers from a different machine pick up the messages based on the message properties. My question was: Does the consumer/producer need to implement the same protocol, or Would it be possible to have a producer send

ActiveMQ Producer Multiple Queues One Session

被刻印的时光 ゝ 提交于 2019-12-25 09:03:33
问题 How is it possible to enqueue messages to different queues using a persistent connection / session in ActiveMQ? What I have done: public class ActiveMQProducer { private static final Logger LOGGER = Logger.getLogger(ActiveMQProducer.class); private Connection connection; private MessageProducer producer; private Session session; String activeMQConnection; public ActiveMQProducer() throws ConfigurationException, JMSException { activeMQConnection = ActiveMQPropertyManagerFactory.getInstance()

Transaction not working with activemq + spring-integration + spring-jms

限于喜欢 提交于 2019-12-25 08:57:08
问题 My queue is not getting transacted. I want to that my message should again go in queue if any error occurs but message does not get transacted ( or does not again goes to the queue) Below is my camel configuration file <bean id="txManager" class="org.springframework.jms.connection.JmsTransactionManager"> <property name="connectionFactory" ref="amqConnectionFactory" /> </bean> <bean id="jasypt" class="org.apache.camel.component.jasypt.JasyptPropertiesParser"> <property name="password" value="*

unable to install activemq-web-console in Fuse service mix

最后都变了- 提交于 2019-12-25 08:16:03
问题 "Error executing command: URL [mvn:org.apache.activemq/activemq-web-console/5.4.0/war] could not be resolved." is thrown up when i do features:install activemq-web-console i am using fuse 4.3 回答1: removed the old Url for activemq from features:removeUrl and added the new one mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features and re-installed activemq features . if u are unable to install mvn url's then,u must add the fuse repo's to your maven settings xml. apart from this there is a