spring-jms

How to set ApplicationIdData using MQQueueConnectionFactory?

亡梦爱人 提交于 2019-12-20 04:04:21
问题 Trying to figure out the camel/Spring configuration to set ApplicationIdData using JMS. I know the java way to do it as below, I set MQOO_SET_IDENTITY_CONTEXT using below int putOptions = MQConstants.MQPMO_SET_IDENTITY_CONTEXT; pmo.options =putOptions; and then i set applicationIdData as: MQMessage msg = new MQMessage(); msg.applicationIdData = "SomeId"; msg.writeString(qmessage); queue.put(msg, pmo); Question is, How do I set applicationIdData using JMS/camel/Spring configuration . Below is

Spring JMS(ActiveMQ) delayed delivery of messages

前提是你 提交于 2019-12-20 02:28:28
问题 We're trying to set a delay on some JMS messages, so that a message will only be added to the queue/ received by the listener after x time. So far we've tried 2 approaches that didn't work. 1) According to the spring documentation, we can set the delivery delay on the JMSTemplate. This is the sample code we tried: @Autowired private JmsTemplate jmsTemplate; ... long deliveryDelay = ...; this.jmsTemplate.setDeliveryDelay(deliveryDelay); this.jmsTemplate.convertAndSend( queue.getName(), event);

How to add multiple JMS MessageListners in a single MessageListenerContainer for Spring Java Config

二次信任 提交于 2019-12-19 16:35:26
问题 I had the following xml code in my spring-config.xml <jms:listener-container acknowledge="auto" connection-factory="cachedConnectionFactory" container-type="default" error-handler="consumerErrorHandler" concurrency="20-25"> <jms:listener destination="#{TaskFinished.destination}" method="onMessage" ref="taskFinished" /> </jms:listener-container> Now, I was converting my spring xml configuration file to Java configuration. I translated it like @Bean(name = "consumerJmsListenerContainer") public

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"

How to share messages, published on Topic, between multiple VMs, in Spring Jms Tibjms

久未见 提交于 2019-12-19 04:13:08
问题 My application is consuming messages published to a Topic. I have 3 servers where my application code is running. With current implementation, the messages is distributed to all running VMs i.e. copy of message is received by every consumer. My requirement is that every consumer should receive distinct message i.e. no two consumer should get same message. Below are the libraries I am using: spring jms 4.2.7 Java jms 2.0 tibco jms 8.0 wildfly-swarm as server Currently I have following

How to listen to topic using spring boot jms

ε祈祈猫儿з 提交于 2019-12-19 03:39:39
问题 I am trying to listen to topic using the below snippet. However its listening to queue by default. There is no xml config in this case. I am completely relying on annotations. Moreover I have relied completely on the AutoConfiguration provided by Spring boot. I am not sure how to set the destination type as topic, In JmsListener. Spring JMS gurus please help. @Component public class MyTopicListener { @JmsListener(destination = "${trans.alert.topic}") public void receiveMessage

How to disable Spring @JmsListener programmatically on startup

爷,独闯天下 提交于 2019-12-19 03:19:21
问题 I have a Spring application that has methods annotated with Spring's @JmsListener. The application is deployed on multiple nodes. On some specific nodes I need to disable the JMS listener so that it is not pulling messages off the queue. There appears to be a way to stop the listener after the application has started up. But this appears to leave open the brief window between startup and when the disable code runs where the application instance may consume messages. So instead is there a way

@JmsListener usage for publish-subscribe topic

China☆狼群 提交于 2019-12-18 11:29:06
问题 I am trying to create example for publish-subscribe based on @JmsListener annotation: https://github.com/lkrnac/book-eiws-code-samples/tree/master/05-jms/0515-publish-subscribe Relevant code snippets: @Slf4j @SpringBootApplication @EnableScheduling public class JmsPublishSubscribeApplication { public static void main(String[] args) throws InterruptedException { SpringApplication.run(JmsPublishSubscribeApplication.class, args); } @Bean public ActiveMQTopic simpleTopic() { return new

Could not start 2 embedded active-mq on different ports within different spring boot applications

跟風遠走 提交于 2019-12-17 14:33:51
问题 I have 2 spring-boot applications. Each application has embedded active mq broker. I need to have 2 applications working on the same PC in parallel but it doesn't work now. First application always starts successfully: 2018-02-02 11:48:20.095 INFO 7660 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@53045c6c: startup date [Fri Feb 02 11:48:20 MSK 2018]; root of context hierarchy 2018-02-02 11:48:20.923

Query regarding Spring message-driven-channel-adapter

自古美人都是妖i 提交于 2019-12-14 02:38:51
问题 I am using Spring's message-driven-channel-adapter. My component is consuming message from Tibco Topic and Publishing to RabbitMQ topic So The message flow is as follows: Tibco-> (subscribed by )Component (Published to)-> RabbitMQ The service activator is shown below: as we see there is a input-channel and an output-channel. The bean storeAndForwardActivator will have the business logic (within the method createIssueOfInterestOratorRecord) <int:service-activator input-channel=