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
4
votes
2 answers

not able to remove message from jms activemq queue

i am new to jms technology. I am using activeMQ console for monitoring queues. I am able create queue with message in it. But when I try to remove certain queue.. a exception is coming. Tried many things, but all in vein.. below is my code: code …
JPG
  • 1,247
  • 5
  • 31
  • 64
4
votes
1 answer

How does Setsessiontransacted work in JMSTemplate and DefaultMessageListenerContainer with Pub/sub model

I am using a publisher/subscriber model in which I am using JMSTemplate to publish messages onto a topic. I am using defaultmessagelistenercontainer to subscribe and receive messages. I know I can I set sessionTransacted true in both the…
4
votes
1 answer

Spring JmsTemplate and Apache ActiveMQ, why so many connections?

I have a web application that runs text processing jobs in the background once a message is received on an ActiveMQ which is listened to by a Spring MessageListener....the problem I"m encountering is that once I process around 30 background jobs,…
wsb3383
  • 3,841
  • 12
  • 44
  • 59
4
votes
2 answers

Spring JmsTemplate + Security

I've just refactored some code that published to a JMS topic to use Spring's JmsTemplate class and now I'm receiving an exception stating I'm not authenticated. Previously I created the factory, made a connection, then session etc as…
James
  • 1,720
  • 5
  • 29
  • 50
4
votes
1 answer

Sending a BlobMessage using JmsTemplate with CachingConnectionFactory

I am using ActiveMQ as my message broker and I have a JMS requirement of sending a big document as an input stream to be processed by consumers. The issue I have is that if I use Spring's org.springframework.jms.connection.CachingConnectionFactory…
4
votes
1 answer

Sending Files using Active MQ with BlobMessage

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…
Arun Kumar
  • 6,534
  • 13
  • 40
  • 67
4
votes
3 answers

ACTIVEMQ - How can subscriber receive topic messages when started after publisher?

In my program, I have two modules :- Publisher and Subscriber which communicate via Topic. I understand that in order to receive messages by subscriber, it should be started before publisher. But there may be a scenario where the subscriber goes…
Vishal
  • 189
  • 3
  • 11
3
votes
1 answer

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

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,…
Synesso
  • 37,610
  • 35
  • 136
  • 207
3
votes
1 answer

Set message priority using Spring Boot, JMS and ActiveMq

I'm trying to send messages with different priority with the JmsTemplate using Spring Boot and ActiveMQ and it's not working. I tried this : MessageCreator mc = session -> { TextMessage tm = session.createTextMessage("hello"); …
FaridM
  • 63
  • 2
  • 11
3
votes
1 answer

Duplicated messages on ActiveMQ

I use ActiveMQ as JMS broker and consumer, jmsTemplate to send the messages, 1 non-durable Topic for the moment. During the peak time I have ~100 messages/second. It doesn't matter how many messages are in the queue, but I frequently get…
Dzidas
  • 305
  • 4
  • 13
3
votes
2 answers

No qualifying bean of type 'org.springframework.jms.core.JmsTemplate'

I have following dependencies: org.springframework.boot spring-boot-starter-activemq 1.5.10.RELEASE
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
3
votes
3 answers

How can I delete Messages from a JMS Queue?

I have several jobs that each have multiple messages queued. The messages for each job are randomly interleaved. If a user decides to cancel a job I want to remove all the messages that are part of that job from the queue. I have been able to use…
Solx
  • 4,611
  • 5
  • 26
  • 29
3
votes
0 answers

Spring JmsTemplate single instance for different QoS

I know that JmsTemplate may be shared between multiple threads and used concurrently for sending messages. But what if I want to share one instance, but send messages with different QoS params - say different priority. As far as I can see in the…
Average Joe
  • 643
  • 5
  • 15
3
votes
2 answers

Spring JMS Template - Concurrent Calls

Can I make concurrent calls using Spring JMSTemplate? I want to make 4 external service calls in parallel and am exploring using Spring's JMSTemplate to perform these calls in parallel and wait for the execution to complete. The other option that…
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
3
votes
1 answer

Can Single JMSTemplate be shared in multiple producers?

I want to share the single instance of JMSTemplate for multiple producers connecting to ActiveMQ broker. Sample config:
1
2
3
13 14