Questions tagged [jmstemplate]

Spring helper class that simplifies synchronous JMS access code

Spring provides a JMS integration framework that simplifies the use of the JMS API much like Spring's integration does for the JDBC API.

JMS can be roughly divided into two areas of functionality, namely the production and consumption of messages. The JmsTemplate class is used for message production and synchronous message reception.

The JmsTemplate class is the central class in the JMS core package. It simplifies the use of JMS since it handles the creation and release of resources when sending or synchronously receiving messages.

Code that uses the JmsTemplate only needs to implement callback interfaces giving them a clearly defined high level contract. The MessageCreator callback interface creates a message given a Session provided by the calling code in JmsTemplate. In order to allow for more complex usage of the JMS API, the callback SessionCallback provides the user with the JMS session and the callback ProducerCallback exposes a Session and MessageProducer pair.

206 questions
1
vote
1 answer

JmsTemplate not browsing queue correctly

I am always getting empty list. I have messages on queues which have not been consumed. I am passing the correct queue name. List messages = jmsTemplate.browse(destinationQueueName, (session, browser) -> { Enumeration
hello world
  • 171
  • 3
  • 13
1
vote
1 answer

How to ensure that JMSTemplate caches consumer i.e. com.ibm.mq.jms.MQQueueReceiver?

I am facing a scenario where the reply queue I connect to, runs out of handles. I have traced it to the fact that my JMS Producers are being cached but not my JMS consumers. I am able to send and receive messages just fine so there is no problem…
user1554876
  • 192
  • 3
  • 19
1
vote
1 answer

JmsTemplate fails to send message to ActiveMQ Artemis with "AMQ219007: Cannot connect to server" but can send message with JMS classes

I am trying to send a JMS messages with Spring's JmsTemplate but it fails with this as the root cause shown in the stack trace: AMQ219007: Cannot connect to server I can, however, send a message programming directly against the JMS classes using…
Tim Perry
  • 3,066
  • 1
  • 24
  • 40
1
vote
2 answers

Spring Configuration file error

I am trying to run a simple program using a spring configuration file. In the configuration I am creating a bean for the JMS template. When I run it from eclipse everything works perfect but if I try to run it from the command line I get the…
jim
  • 2,155
  • 2
  • 14
  • 6
1
vote
1 answer

Spring 5 JMS clientID=myapp.Topic was already set into another connection

I am using Spring Boot 2.2.1 (w/ Spring 5) to kick off my server with Spring JmsTemplate (HornetQ) connections. Every ~10s an ERROR is logged, 2020-01-17 18:00:49,091 [DefaultMessageListenerContainer-1] ERROR listener.DefaultMessageListenerContainer…
thlim
  • 2,908
  • 3
  • 34
  • 57
1
vote
0 answers

Message not recovered in DefaultMessageListenerContainer

I have a factory class that I use to create a mq consumer and a DefaultMessageListenerContainer bean from that consumer that will be used for consuming messages from a topic. It goes like this - public class MQMessageFactory { public static…
Innovationchef
  • 338
  • 2
  • 10
1
vote
2 answers

jackson.databind.ObjectMapper upperCasing json Array and Object names

I am trying to use JMSTemplate to publish a JSON message to a topic. This code already existed in one application and I was simply copying it to another as we are trying to consolidate two applications into one. I have found that the code is now…
Kachopsticks
  • 125
  • 1
  • 13
1
vote
1 answer

JmsTemplate Invocation Latency in High Concurrency

We are currently doing Load Test with over 200 TPS to simulate high concurrency with the application using Spring Boot 2.1.1 and Spring JMS with IBM MQ Spring Boot Starter v2.1.1. Also, we configured MQ connection pool to have 500 max connection…
Michael J
  • 21
  • 3
1
vote
0 answers

Latency observed using JmsTemplate async sending of messages

JmsTemplate doesn't have build-in API to support JMS 2.0 async sending. I use the ProducerCallback object and call JMS 2.0 async sending API directly on JMS MessageProducer. The message sent successfully. But if I send 2 large messages (2M message),…
zhvfeng
  • 11
  • 3
1
vote
0 answers

How to fix message converter miss understanding object type for Jackson parsing

I setting up MessageConverter with MappingJackson2MessageConverter for JmsTemplate. Where do I expect that I can cast message to my object class but it does not happened! I write MessageConverter as follow that it used for my JmsTemplate sending…
Roozbe
  • 259
  • 2
  • 13
1
vote
1 answer

MQRC_UNKNOWN_ALIAS_BASE_Q when connecting with IBM MQ cluster using CCDT and Spring Boot JMSTemplate

I have a Spring Boot app using JMSListener + IBMConnectionFactory + CCDT for connecting an IBM MQ Cluster. A set the following connection properties: - url pointing to a generated ccdt file - username (password not required, since test…
Kumite
  • 2,129
  • 3
  • 15
  • 15
1
vote
2 answers

Understanding JMS integration testing with Spring SingleConnectionFactory and CachingConnectionFactory

Please some help understanding the following: I am using CachingConnectionFactory in my app and first used it during my jms tests to test my jms config like guaranteed delivery, rollback/commit, etc.. I am using Spring's JmsTemplate for sending and…
edbras
  • 4,145
  • 9
  • 41
  • 78
1
vote
1 answer

JmsTemplate with RECEIVE_TIMEOUT_NO_WAIT doesn't retrieve messages from JMS queue

Given I have ActiveMQ queue where many messages are already present. When I set receive timeout on JmsTemplate to RECEIVE_TIMEOUT_NO_WAIT which is equal to -1: jmsTemplate.setReceiveTimeout(JmsTemplate.RECEIVE_TIMEOUT_NO_WAIT); and try to receive…
Patrik Mihalčin
  • 3,341
  • 7
  • 33
  • 68
1
vote
0 answers

ActiveMQ publish completes but see no messages in queue

Update: I switched to another queue and I can see my messages, as expected. So it means there is something different about the initial queue I tried. It does not have any consumers. What could cause the queue to not show any messages in the web…
onepiece
  • 3,279
  • 8
  • 44
  • 63
1
vote
1 answer

JMS Topic Subscriber in Spring using JMS template/ Message Subscriber

I have a simple Spring application for JMS Producer/Subscriber using ActiveMQ with below configuration : Application Context xml :
Sandip Jangra
  • 145
  • 2
  • 9