spring-jms

Spring 4 CachingConnectionFactory with JMS 2.0 doesn't properly cache Producers

ε祈祈猫儿з 提交于 2020-01-03 08:49:11
问题 We just upgraded to Spring 4 and JMS 2.0. We are using a CachingConnectionFactory and a JmsTemplate to publish messages and noticed that when publishing to a destination, the first attempt works and then further attempts to publish to the same destination cause the following exception: Caused by: javax.jms.IllegalStateException: The producer is closed Everything worked fine with Spring 3.2 and JMS 1.1 so I did some digging to see what the problem was and it seems the issue is in the

Using Circuit Breaker with camel -ThrottlingExceptionRoutePolicy

≯℡__Kan透↙ 提交于 2020-01-03 03:28:11
问题 There is a route which is consuming messages from a jms queue and after doing some processing sending a request to unreliable web service(Which can be down at times). So in case of service is down then i need to stop consuming from queue for some time. I tried to use ThrottlingExceptionRoutePolicy . It will stop route as per configuration but issue is for the current message which gets the error as message is getting moved to dead letter queue. I've gone through the code of

How to listen to dynamic destinations using Spring Boot?

拟墨画扇 提交于 2020-01-03 02:58:29
问题 We have an application using Spring Boot and its JMS facility. At runtime, we have different producers that jump online and tell our application the name of the topic or queue to listen to. Right now, we have: @JmsListener(destination = "helloworld.q") public void receive(String message) { LOGGER.info("received message='{}'", message); } which works when we send a message to the helloworld.q topic. The problem is, we won't know what the name of the topic will be until runtime, and JmsListener

Load balancing issue while connecting to IBM MQ using JMS + CCDT file

亡梦爱人 提交于 2020-01-02 08:17:21
问题 We are trying to connect to IBMMQ using CCDT file and JMS configuration. We are able to connect to it but we have an issue here: since we are using spring to set connection factory with CCDT file, this is initialized once at the start of the application, but unfortunately it picks only one queue manager at a time,i.e it sends all the messages to same queue manager and it does not load balance. Though i observed, if i manually set the CCDT file before every request then its able to load

Load balancing issue while connecting to IBM MQ using JMS + CCDT file

☆樱花仙子☆ 提交于 2020-01-02 08:17:20
问题 We are trying to connect to IBMMQ using CCDT file and JMS configuration. We are able to connect to it but we have an issue here: since we are using spring to set connection factory with CCDT file, this is initialized once at the start of the application, but unfortunately it picks only one queue manager at a time,i.e it sends all the messages to same queue manager and it does not load balance. Though i observed, if i manually set the CCDT file before every request then its able to load

How to set ActiveMQ port in Spring Boot?

◇◆丶佛笑我妖孽 提交于 2020-01-02 03:29:28
问题 I have two Spring Boot applications running on one server. Both use embedded ActiveMQ JMS. I want to have separate JMS instance for each application. How could I set the port for each of them? Is there any property like spring.activemq.port ? When I run second application I get the following expected error: Failed to start JMX connector Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi].

Set timeOut for session/transaction to DefaultMessageListenerContainer

邮差的信 提交于 2019-12-29 10:03:48
问题 I want to receive chunk of messages from Queue within some timeLimit(Ex : 300 millisec after receiving the 1st message) using DefaultMessageListenerConatiner Of Spring (By overriding doReceiveAndExecute) as mentioned in the link. I can group the messages of my batch size i.e 20 when the queue is having too many messages and I can receive less than 20 messages when there are very less messages in Queue. Issue : I see it takes too much time(sometimes 1 sec and sometime 2 secs and more) for

Set timeOut for session/transaction to DefaultMessageListenerContainer

隐身守侯 提交于 2019-12-29 10:00:08
问题 I want to receive chunk of messages from Queue within some timeLimit(Ex : 300 millisec after receiving the 1st message) using DefaultMessageListenerConatiner Of Spring (By overriding doReceiveAndExecute) as mentioned in the link. I can group the messages of my batch size i.e 20 when the queue is having too many messages and I can receive less than 20 messages when there are very less messages in Queue. Issue : I see it takes too much time(sometimes 1 sec and sometime 2 secs and more) for

Execution of JMS message listener failed, and no ErrorHandler has been set

╄→гoц情女王★ 提交于 2019-12-29 06:42:03
问题 When I use Spring to listen to JMS messages, I receievd the above error. I am wondering how to add an Errorhandler into the JMS listener? 回答1: There is a property on AbstractMessageListenerContainer: <bean id="listener" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="errorHandler" ref="someHandler"/> <property name="destinationName" value="someQueue"/> <property name="connectionFactory" ref="connectionFactory"/> </bean> Where someHandler is a bean

Why DefaultMessageListenerContainer should not use CachingConnectionFactory?

家住魔仙堡 提交于 2019-12-28 01:01:28
问题 I was reading spring documentation on DefaultMessageListenerContainer It says "Note: Don't use Spring's CachingConnectionFactory in combination with dynamic scaling. Ideally, don't use it with a message listener container at all, since it is generally preferable to let the listener container itself handle appropriate caching within its lifecycle. Also, stopping and restarting a listener container will only work with an independent, locally cached Connection - not with an externally cached one