spring-jms

How to setup ContentType for Azure ServiceBus from Spring JMS

ε祈祈猫儿з 提交于 2021-02-11 12:24:40
问题 I'm trying to use library azure-servicebus-jms-spring-boot-starter to send messages to topic. Everything works, however messages are being stored in subscriptions as application/xml type and I can't find the way how to setup this correctly to have them stored as application/json . I've tried to configure message converter to send ContentType as described here but that doesn't work either. @Bean public MessageConverter jacksonJmsMessageConverter() { final MappingJackson2MessageConverter

ActiveMq transaction on @JmsListener

只愿长相守 提交于 2021-02-10 06:38:47
问题 I try to make a Jms consumer with activeMq broker witch have an "transactional" acknowledge. I want to use spring boot application. I read that I need JTA transaction but I don't know how I can start one. My main class: @SpringBootApplication @EnableJms public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } My consumer : @Component public class ReceiveMessage { @JmsListener(destination = "${jms.queue.destination}") public void

How to generate WebSphere MQ Message from Spring JMS?

不打扰是莪最后的温柔 提交于 2021-02-10 05:18:10
问题 I need to produce queue message in WebSphere MQ message format. By default spring produced the message in JMS format. I have googled and came to know that WebSphere MQ Message format contains MQMD and RFH2 header. No idea how to generate these two from Spring. 回答1: Where Tomcat context.xml is the JNDI provider for MQ, I did it like this: <Resource name="jms/myreqqueue" auth="Container" type="com.ibm.mq.jms.MQQueue" factory="com.ibm.mq.jms.MQQueueFactory" QU="MY.REQ.QUEUE" TC="1" /> Notice the

How to generate WebSphere MQ Message from Spring JMS?

空扰寡人 提交于 2021-02-10 05:13:57
问题 I need to produce queue message in WebSphere MQ message format. By default spring produced the message in JMS format. I have googled and came to know that WebSphere MQ Message format contains MQMD and RFH2 header. No idea how to generate these two from Spring. 回答1: Where Tomcat context.xml is the JNDI provider for MQ, I did it like this: <Resource name="jms/myreqqueue" auth="Container" type="com.ibm.mq.jms.MQQueue" factory="com.ibm.mq.jms.MQQueueFactory" QU="MY.REQ.QUEUE" TC="1" /> Notice the

Proper ultimate way to migrate JMS event listening to Spring Integration with Spring Boot

眉间皱痕 提交于 2021-02-08 10:25:22
问题 I got a JmsConfig configuration class that handles JMS events from a topic in the following way: It defines a @Bean ConnectionFactory , containing an ActiveMQ implementation It defines a @Bean JmsListenerContainerFactory instantiating a DefaultJmsListenerContainerFactory and passing it through Boot's DefaultJmsListenerContainerFactoryConfigurer It defines a @Bean MessageConverter containing a MappingJackson2MessageConverter and setting a custom ObjectMapper I use @JmsListener annotation

Spring JMS Consumers to a TIBCO EMS Server expire on their own

核能气质少年 提交于 2021-02-08 10:21:12
问题 We have built a Spring Boot messaging service that listens to a JMS queue hosted on a TIBCO EMS (Enterprise Messaging Service) Server. It is a fairly straightforward application that receives a JMS message, does some data manipulation and updates a database. The issue is that, occasionally, there are no JMS consumers on the queue, and incoming messages are not processed. However the Spring Boot app is up and running (verified by ps -ef). Restarting the app restores the consumer, but

How to pause/resume individual Spring JMS message listeners

依然范特西╮ 提交于 2021-02-05 11:23:21
问题 My Spring Boot JMS application is consuming messages from several SQS queues. Each queue needs to connect to a different external resource in order to process its messages. If there's an external resource failure I expect the consumer requiring that resource will rapidly drain the queue to a DLQ and that's no fun. I need to be able to suspend (pause) the message listener for each consumer independently when my code detects that its resource is offline (e.g. comms exception calling REST

How to push the failure messages to Azure service bus Dead Letter Queue in Spring Boot Java?

做~自己de王妃 提交于 2021-01-29 10:31:21
问题 I'm using JMS Listener to read the message from the Azure topic and processing the message, Once the process completed I'm pushing back to another topic. I successfully completed functionality with help of spring documentation. Now I need to handle failure messages - Error handler. In case If we have an exception while reading or processing the message means I need to push it to the Dead letter Queue. Sample code I tried based on Spring Documentation. @Component public class Receiver {

Performance issues with ActiveMQ Artemis and Spring JmsTemplate

核能气质少年 提交于 2021-01-29 08:14:54
问题 While doing some load tests with the ActiveMQ Artemis broker and my Spring Boot application I am getting into performance issues. What I am doing is, sending e.g. 12,000 messages per second to the broker with JMSeter and the application receives them and saves them to a DB. That works fine. But when I extend my application by a filter mechanism, which forwards events after saving to DB, back to the broker using jmsTemplate.send(destination, messageCreator) it goes very slow. I first used

SpringJMS - How to Disconnect a MessageListenerContainer

可紊 提交于 2021-01-28 08:27:58
问题 I want to disconnect the DefaultMessageListenerContainer for a queue. I am using dmlc.stop(), dmlc.shutdown(). At the time of conneciton 5 consumer threads get connected to queue. when I try to disconnect, 4 of the consumers get disconnected, but 1 consumer remains connected. (See screenshot at the end of thread). Environment 1. ActiveMQ with AMQP 2. SpringJMS with ApacheQpid Problem After calling destroy and stop method, there's still one consumer connected to the queue. Required Solution I