spring-jms

How to listen to dynamic destinations using Spring Boot?

别来无恙 提交于 2019-12-06 15:48:43
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 seems to want a constant expression. Message producers will hook into our ActiveMQ instance and

How is jms session handled in a flow containing inbound adapter, outbound adapter, error channel and configured with same CachingConnectionfactory

烈酒焚心 提交于 2019-12-06 08:57:16
I have the following flow: 1) message-driven-channel-adapter -> 1.1) output-channel connected to -> service-activator -> outbound-channel-adapter (for sending response) 1.2) error-channel connected to -> exception-type-router 1.2.1) message is sent to different queues depending on the exception type using outbound-channel-adapter MessageDrivenChannelAdapter uses DefaultMessageListenrContainer and OutboundAdapter uses JMSTemplate Have used same cachingconnectionfactory for inbound and outbound adapters, set acknowledge="transacted" in messageDrivenChannelAdapter set cacheLevel as CACHE_CONSUMER

DefaultJmsListenerContainerFactory vs DefaultMessageListenerContainer

给你一囗甜甜゛ 提交于 2019-12-06 03:05:51
问题 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

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

大城市里の小女人 提交于 2019-12-06 02:31:08
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 balance the Queue Managers, ideally it looks to me Queue Manager is decided whenever i set the URL to CCDT

complete jms:listener migration to JavaConfig

£可爱£侵袭症+ 提交于 2019-12-06 01:25:17
Like the title says.. I have read this valuable How to add multiple JMS MessageListners in a single MessageListenerContainer for Spring Java Config link The author of that post is working through messageListenerContainer.setMessageListener(new TaskFinished()); BTW: I use @Autowired private ConsumerListener consumerListener; defaultMessageListenerContainer.setMessageListener(consumerListener); I am not using the new operator. OK, the restriction of the setMessageListener method is: the class must implements the MessageListener interface, I have tested and works My problem is, according with 23

Java Spring JMS: JmsTemplate to IBM MQ

安稳与你 提交于 2019-12-05 23:52:17
Update It was my mistake I forget the ssl debugging running, it is super fast now and working like magic I have a Spring Boot application that connects to IBM MQ using spring JMS. I realized that the jmsTemplate is super slow compared to not using Spring at all. I am sure I have something not configured correctly. Hope Someone can help. I create a connection factory using IBM MQ 8 jar files. @Bean public ConnectionFactory connectionFactory() { properties.getCipherSpec()); MQConnectionFactory factory = new MQConnectionFactory(); try { factory.setHostName(properties.getHost()); factory.setPort

Not seeing message properties that I set explicitly (Spring/JMS/MQ)

久未见 提交于 2019-12-05 22:54:44
Two separate processes are communicating via JMS over MQ. The writer sets a string property: new MessageAction() { public void actOn(Message message) throws JMSException { logger.debug("Setting message property (GmmThreadId, CASHFLOW-1234)"); message.setStringProperty("GmmThreadId", "CASHFLOW-1234"); } }); This MessageAction is executed, as shown in the logs: Setting message property (GmmThreadId, CASHFLOW-1234) The reader uses a message selector to obtain this message. (using Spring's JmsTemplate v1 - an old version I know, but it's baked into our vendor's framework and we're compelled to use

Sending Files using Active MQ with BlobMessage

為{幸葍}努か 提交于 2019-12-05 18:17:43
I have an requirement in my application to send files from one application to another over HTTP/FTP protocol. I found following link which tells that the same can be done using Active MQ with supoort of Blob messages: activemq.apache.org/blob-messages.html I configured ActiveMq 5.8 on my windows machine, included required dependency for ActiveMQ lib in my pom.xml and i am able to send the simple javax.jms.TextMessage and javax.jms.MapMessage with org.springframework.jms.core.JmsTemplate But while i moved to send BlobMessage using following method, a compile time error arises while creating the

ThreadPoolExecutor : : TaskRejectedException from Executor

岁酱吖の 提交于 2019-12-05 17:13:11
My application is reading messages through Jms MessageListener class and at some point of time it is throwing TaskRejectedException . I know most of you will say that the number of threads is exceeded by maxPoolSize and queue is also full. But I observed something. The number of messages sent to the queue from which the MessageListener class is fetching messages is 10353 and my spring property for threadPoolExecutor is below : <bean id="ticketReaderThreadPool" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" scope="singleton" destroy-method="destroy"> <property name=

How to thread pool a Spring JMS listener

☆樱花仙子☆ 提交于 2019-12-05 16:40:29
I am setting up a JMS subscriber listener as follows with the goal of achieving a pool of 5 threads listening to topATopic, however, what I see at runtime is multiple consumers processing the same record (recordCount*#of consumers). I am assuming I am doing something wrong considering I am new to spring. <bean id="messageListener" class="com.abc.app.mdp.Receiver"> <property name="bean" ref="bean" /> </bean> <jms:listener-container container-type="default" connection-factory="connectionFactory" acknowledge="auto" concurrency="5" destination-type="topic" prefetch="1" cache="none" > <jms:listener