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
3
votes
0 answers

Spring JMS - autowire JmsTemplate bean failed

I set up JMS application based on the http://bsnyderblog.blogspot.com/2010/02/using-spring-jmstemplate-to-send-jms.html However I cannot start tomcat because I've got following exeption: Context initialization…
zleek
  • 201
  • 4
  • 16
3
votes
1 answer

spring activemq jmsTemplate.setTimeToLive take longer time more than the specified miliseconds to delete the message

i need to delete a message after specific time so i enabled the explicitQosEnabled and set the time to live. but i noticed that the message is deleted but it takes longer time than the specified(one minute) so anyone faced this issue before?
user181777
  • 31
  • 1
3
votes
1 answer

Exception handling in JmsTemplate send

I want to send a large string message (3-5 MB) with jmstemplate (with activemq jms broker). In the middle of sending the message, i shutdowned my broker; Why i can't catch throwed exception in catch(Exception e)? What should i do to handle this…
Arya
  • 2,809
  • 5
  • 34
  • 56
3
votes
2 answers

Creating temporary JMS jms topic in Spring

I'm trying to refactor some legacy code to use Spring to handle the jms connections to a mainframe service. I need to connect create a temporary topic for the mainframe service reply and set that as the message.setJMSReplyTo(replyTo); in the message…
Rob
  • 245
  • 1
  • 5
  • 14
3
votes
2 answers

JBoss doesn't sends a JmsTemplate (Spring) message

Well, actually JBoss does send the message, but only when the current transaction started by the EJB is finished. We have this problem with JBoss 4.0.3 and Spring's JmsTemplate. An EJB sends a message to a queue with a temporary queue as the…
Eldelshell
  • 6,683
  • 7
  • 44
  • 63
2
votes
1 answer

Autowire of jms template or other beans inside listener with custom containerfactory is null

I have created a custom jmsListenerContainerFactory and MessageListenerContainer for batch processing. The problem is when I pass my custom container factory in @JmsListener(containerFactory=" customContainerFactoryq1") in the listener file,…
2
votes
2 answers

why is JmsTemplate.receive method returning a null object?

I'm using Mockito to create a mock message object(inorder to test a ibmMqService) but jmsTemplate is returning a null public class ImqMqServerTest { @InjectMocks IbmMqService ibmMqService; @Mock JmsTemplate jmsTemplate; …
Thivya Thogesan
  • 206
  • 2
  • 12
2
votes
1 answer

How to create a topic exchange in Qpid JMS for ActiveMQ like RabbitMQ?

I've got a Java application that uses RabbitMQ. This application creates a TOPIC exchange and pushes messages to the TOPIC with its own routing key. From this way if I want the data from any application I create a queue binding with the exchange…
CarlosS
  • 161
  • 1
  • 13
2
votes
1 answer

What precisely means setSessionTransacted in JMSTemplate?

Please explain me if I understood correctly Spring documentation. Spring docs states: https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#jms-tx (...)When you use the JmsTemplate in an unmanaged environment, you…
michaldo
  • 4,195
  • 1
  • 39
  • 65
2
votes
1 answer

Does JMSTemplate producer open a thread for each message?

I'm building a REST API application with Spring Boot 2.1.6. I want to use JMS messaging in my app with Active MQ package (org.apache.activemq). I have MyEventController class which receives all kinds of events through http requests. I then want to…
hitchhiker
  • 1,099
  • 5
  • 19
  • 44
2
votes
1 answer

Is it possible to enforce message order on ActiveMQ topics using Spring Boot and JmsTemplate?

In playing around with Spring Boot, ActiveMQ, and JmsTemplate, I noticed that it appears that message order is not always preserved. In reading on ActiveMQ, "Message Groups" are offered as a potential solution to preserving message order when…
SoCal
  • 801
  • 1
  • 10
  • 23
2
votes
1 answer

Problem with text message encoding when sending to ActiveMQ with JmsTemplate

When I send text message containing russian characters to ActiveMQ I get abracadabra. I use org.springframework.jms.core.JmsTemplate, jmsTemplate.convertAndSend. How to specify UTF-8 encoding. Is a problem in the rpoperties of JmsTemplate bean, or…
Denis Savrasov
  • 111
  • 1
  • 2
  • 10
2
votes
1 answer

How to use JmsTemplate.sendAndReceive

I want to get sync response from jmsTemplate.sendAndReceive: Message responseMessage = producer.produceAndReceive(gzip, mestype, uploadFile.getName(), uploadFile.getAbsolutePath()); It calls produceAndReceive in another class: @Override …
advortsov
  • 196
  • 2
  • 8
2
votes
1 answer

Problem while using springs TransactionSynchronizationManager

I am using spring TransactionSynchronizationManager.Using this manager I register a new Synchronization TransactionSynchronizationAdapter and I override the afterCompletion(int status) method of this TransactionSynchronizationAdapter . Inside this…
Ashish Sharma
  • 1,597
  • 7
  • 24
  • 35
2
votes
1 answer

Spring 3 JmsTemplate in out queue different

org.springframework.jms.core.JmsTemplate only supports one queue using defaultDestination..... what do I need to do when I have different in and out bound queue? thanks
john
  • 219
  • 2
  • 5
  • 12
1 2
3
13 14