jms

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()

How to aggregate CSV lines with Apache Camel?

不打扰是莪最后的温柔 提交于 2019-12-25 08:57:44
问题 I have a CSV similar to this: County City Area Street county1 city1 area1 street1 county1 city1 area2 street2 county1 city1 area3 street7 county1 city2 area2 street2 county1 city2 area6 street1 county2 city1 area3 street3 county2 city1 area3 street2 ... During the CSV parsing, I need to aggregate the same County/City to create a final structure like this: county1/city1: [ [area1, street1], [area2, street2], [area3, street7] ] county1/city2: [ [area2, street2], [area6, street1] ] county2/city1

what is benefit of sending xml using jms

百般思念 提交于 2019-12-25 08:05:53
问题 In out current project we have been sending xml as textmessage using jms. I do not understand why are they not simply sending Objectmessage, why have the overhead of processing xml ? so the question basically boils down to why use xml in jms ? 回答1: It all boils down to a design decision on the message serialization format. At first Objectmessage would appear to be the most efficient mechanism. However it would not work well in the following scenarios: Message validation (XML Schemas act as a

Consume message only once from Topic per listeners running in cluster

丶灬走出姿态 提交于 2019-12-25 07:46:29
问题 I'm implementing an Domain Event infrastructure, but the project doesn't allow any messaging infra(financial services client) so found an alternative in Hazelcast Topics and ExecutorService, But the problem is when running in cluster the message shall be delivered to listeners which is going to be running in cluster, so for a cluster of 2, we have same listener running in 2 jvm, and message consume twice and acted upon, suppose the Domain event is supposed to perform some non idempotent

Queue Fairness and Messaging Servers

試著忘記壹切 提交于 2019-12-25 07:35:03
问题 I'm looking to solve a problem that I have with the FIFO nature of messaging severs and queues. In some cases, I'd like to distribute the messages in a queue to the pool of consumers on a criteria other than the message order it was delivered in. Ideally, this would prevent users from hogging shared resources in the system. Take this overly simplified scenario: There is a feature within an application where a user can empty their trash can. This event dispatches a DELETE message for each item