spring-jms

Properly Shutting Down ActiveMQ and Spring DefaultMessageListenerContainer

半腔热情 提交于 2019-12-05 08:00:44
Our system will not shutdown when a "Stop" command is issued from the Tomcat Manager. I have determined that it is related to ActiveMQ/Spring. I have even figured out how to get it to shutdown, however my solution is a hack (at least I hope this isn't the "correct" way to do it). I would like to know the proper way to shutdown ActiveMQ so that I can remove my hack. I inherited this component and I have no information about why certain architectural decisions were made, after a lot of digging I think I understand his thoughts, but I could be missing something. In other words, the real problem

Writing tests to verify received msg in jms listener (Spring-Boot)

孤街醉人 提交于 2019-12-04 22:11:55
问题 I want to write test for something like below; There is a listener called state-info-1 in src/main . It does some changes to any message it gets and publishes the new message on activemq topic state-info-2 . I will build a dummy message and publish on to activemq topic state-info-1 . Finally verify that, the received message on topic state-info-2 is like i expected. My Listeners are like; @JmsListener(destination = "state-info-1", containerFactory = "connFactory") public void receiveMessage

Spring web to connect to HornetQ JMS embeded with Jboss server 7.1.1

跟風遠走 提交于 2019-12-04 15:18:53
I am trying to setup spring-web to connect to remote Jboss-7.1.1 HornetQ JMS by following this site. But I am getting below error, is there anything I need to add the spring-bean configuration. The current spring-web runs on tomcat. spring-bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:p="http://www.springframework.org/schema/p" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www

JMS connections exhausted using WebSphere MQ

有些话、适合烂在心里 提交于 2019-12-04 09:31:37
I have configured CachingConnectionFactory that wraps a MQTopicConnectionFactory and MQQueueConnectionFactory with cache size set to 10 each. These are than used in several jms:outbound-channel-adapter or jms:message-driven-channel-adapter as part of various spring integration workflows that I have in my application. It is noticed that once in a while the connection count on MQ channel reaches maximum allowed (about 1000) when the process stops functioning. This is a serious problem for a production application. Bringing the application down does not reduce the connection count so looks like

DefaultJmsListenerContainerFactory vs DefaultMessageListenerContainer

荒凉一梦 提交于 2019-12-04 08:32:41
What are the advantages of using DefaultJmsListenerContainerFactory over DefaultMessageListenerContainer ? If i configure DMLC directly , i do get a handle to check the status by calling isRunning() . Also i do get a facility to start and stop the DMLC However, per new spring specs, if i configure DefaultJmsListenerContainerFactory , i do not get handle of DMLC, so i am unable to do any of above operations. So looking at above limitation, can somebody explain why one should use DefaultJmsListenerContainerFactory over DMLC Also, if i use DefaultJmsListenerContainerFactory , what are the ways to

Use case scenario of durable listeners/consumers

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 05:51:55
问题 So I am creating concurrent consumers to a topic i.e. multiple listeners. I am configuring them to be durable. @Bean public DefaultMessageListenerContainer listenerContainers() { DefaultMessageListenerContainer container = new DefaultMessageListenerContainer(); container.setConnectionFactory(connectionFactory()); container.setDestinationName(COMMENT_QUEUE); container.setPubSubDomain(true); container.setSessionTransacted(true); container.setConcurrentConsumers(2); container

Spring Bean Custom Scope JMS

白昼怎懂夜的黑 提交于 2019-12-04 03:44:48
问题 I am using Spring Framework to concurrently consume messages off of a JMS queue using a DefaultMessageListenerContainer . I want the ability to create new instances of the beans that are autowired for each message that comes in. I thought setting the scope="prototype" would work but it doesn't seem to do the job. Does anybody know of a custom bean scope that would create new instances per JMS message ? Much like the "request" scope does for HTTP Requests? I realize that I could make com

Writing tests to verify received msg in jms listener (Spring-Boot)

人走茶凉 提交于 2019-12-03 15:07:03
I want to write test for something like below; There is a listener called state-info-1 in src/main . It does some changes to any message it gets and publishes the new message on activemq topic state-info-2 . I will build a dummy message and publish on to activemq topic state-info-1 . Finally verify that, the received message on topic state-info-2 is like i expected. My Listeners are like; @JmsListener(destination = "state-info-1", containerFactory = "connFactory") public void receiveMessage(Message payload) { // Do Stuff and Publish to state-info-2 } Is it possible i can write test for this?

How to simulate message redelivery in AUTO_ACKNOWLEDGE JMS Session Scenario?

大城市里の小女人 提交于 2019-12-03 07:52:15
In the following test I'm trying to simulate the following scenario: A message queue is started. A consumer designed to fail during message processing is started. A message is produced. The consumer starts processing the message. During processing an exception is thrown to simulate message processing failure. The failing consumer is stopped. Another consumer is started with the intent to pick up the redelivered message. But my test fails and the message is not redelivered to the new consumer. I'll appreciate any hints on this. MessageProcessingFailureAndReprocessingTest.java

jms producer performance with spring

空扰寡人 提交于 2019-12-03 04:52:29
问题 i created a simple producer consumer simulation based on spring, jms and activemq, i'm trying to reach high performance from both sides, producers and consumers, Connection settings : <tx:annotation-driven /> <bean id="transactionManager" class="org.springframework.jms.connection.JmsTransactionManager"> <property name="connectionFactory" ref="connectionFactory" /> </bean> <amq:connectionFactory id="amqConnectionFactory" brokerURL="failover:(tcp://${broker.url}:61616)" /> <bean id=