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
0
votes
1 answer

Reply-To Queue is not updating in IBM MQ while putting message type as request

jmsTemplate.sendAndReceive("Queue2", session -> { TextMessage msg = session.createTextMessage(); msg.setText(message); msg.setJMSReplyTo(config.getReplyQ()); //Not updated but auto generated queue…
0
votes
2 answers

How to Find Session Cache exhaustion in CachingConnectionFactory

We are using Spring CachingConnectionFactory to produce the message to a IBM MQ topic using Spring JmsTemplate We have set the sessionCacheSize as 50 :- cachingConnectionFactoryBean .setSessionCacheSize(50)); Intermittently, i am seeing…
Neer1009
  • 304
  • 1
  • 5
  • 18
0
votes
1 answer

java grpc server for a bi-directional stream that connect activemq to push & get message from activemq

I am trying to write a java grpc server for a bi-directional stream that connect activemq to push & get message from activemq I am able to instantiate a Stream observer on the server. However the problem is once i get data from grpc client on…
0
votes
0 answers

Publishing messages to AMQ in Spring Boot using jmsTemplate Asynchronously

Iam trying to publish messages to AMQ using jmsTemlate in Spring Boot project Asyncronously using below code. @Async public void sendMessage(String text, String eventName, long entityPk, String messageId, String messageType, long messageVersion,…
0
votes
3 answers

Unable to post message to IBM MQ Queue

I am trying to connect to IBM MQ and post message. getting below exception but the same code works in development…
sasrra
  • 77
  • 1
  • 3
  • 13
0
votes
1 answer

jmsTemplate is not auto initializing in Spring Boot

Below is my following Spring Boot Application where I am trying to send the message to Queue but it always throw the NULL on jmsTemplate. Per Spring documentation jmsTemplate should auto configured but it is not happening. is that something I am…
user1591156
  • 1,945
  • 4
  • 18
  • 31
0
votes
1 answer

How to set timeout for each message JmsListener receives?

I have a Spring JmsListener which receives messages from an SQS queue. Now I need to set processing_timeout for each message I receive. Lets assume that I have set processing_timeout to 2 mins, then each message received by Jmslistener should finish…
LearnerForLife
  • 147
  • 1
  • 12
0
votes
1 answer

Spring JmsTemplate destination specific message persistence

I am using a JmsTemplate (spring-jms-5.2.8) for sending messages to an embedded ActiveMQ broker to a several topics. I want some of the topics to be persistent (the messages sent to them to be persisted) and some of them not. Unfortunately, the…
Tomask
  • 2,344
  • 3
  • 27
  • 37
0
votes
1 answer

how to read messages by packet with JmsTemplate of Sring

i have an outOfMemoryException while reading messages from a queue with 2 M of messages. and i am trying to find a way to read messgages by 1000 for example . here is my code List messages = jmsTemplate.browse(JndiQueues.BACKOUT,…
Ares
  • 71
  • 1
  • 10
0
votes
0 answers

Replay/synchronous messages memory not released for messages sent by producers to queue in SpringBoot JMS with ActiveMQ

1. Context: A two-modules/microservice application developed with SpringBoot 2.3.0 and ActiveMQ. Also we use ActiveMQ 5.15.13 server/broker. Broker is defined in both modules with application properties. Also broker connection pool is defined in…
0
votes
2 answers

How do I debug JmsTemplate?

I am using SpringsourceTool and the Spring framework. I have some code that uses JmsTemplate to send messages via convertAndSend(Object). I want to debug it as a JUnit test. So, for the test class, I select Run->Debug As->JUnit Test. I set a…
oky_sabeni
  • 7,672
  • 15
  • 65
  • 89
0
votes
1 answer

how to add delivery delay on AWS SQS messages using Spring JmsTemplate

Hi I want to implement the function like sending sqs messages with a specific delivery delay using java and JmsTemplate. Actually, I finished the implementation of sending messages without delay. like this: @Override public boolean…
Hongli Bu
  • 461
  • 12
  • 37
0
votes
2 answers

Should I manually reset state-data of Autowired Bean in Spring (since it is Singleton)?

I am using org.springframework.jms.core.JmsTemplate; in my project to send messages to SQS queues. I autowired JmsTemplate in a @Service import org.springframework.beans.factory.annotation.Autowired; import…
Hongli Bu
  • 461
  • 12
  • 37
0
votes
2 answers

Spring JMS consumer pull

I need to implemt a pulling consumer. Most of the examples I see are the producer pushing a message to the consumer; Assuming consumer is always up. I want the producer to push messages to a queue and the consumer to consume those messages on its…
0
votes
2 answers

How to create MQRFH2 Header with "Other" (not usr area) folder with JMS

Using Spring's JmsTemplate message.setStringProperty("param", "value") one can set the value in MQRFH2.usr. How can we set values in MQRFH2.other?