jms

Load balancing issue while connecting to IBM MQ using JMS + CCDT file

☆樱花仙子☆ 提交于 2020-01-02 08:17:20
问题 We are trying to connect to IBMMQ using CCDT file and JMS configuration. We are able to connect to it but we have an issue here: since we are using spring to set connection factory with CCDT file, this is initialized once at the start of the application, but unfortunately it picks only one queue manager at a time,i.e it sends all the messages to same queue manager and it does not load balance. Though i observed, if i manually set the CCDT file before every request then its able to load

How to clean HornetQ messaging journal before/after performing a test?

不打扰是莪最后的温柔 提交于 2020-01-02 06:57:12
问题 There's an Arquillian integration test using JMS HornetQ with persisted messages. Some test leave the messaging journal filled with unhandled messages that break other tests expecting no data. Is there a way of telling JMS to clean its messaging journal before or after executing a test? 回答1: This does not exist in the JMS API itself, but there's a method 'removeMessages(filter)' in the HornetQ QueueControl management object. This method can be found in the JMX Bean for the Queue, but I wouldn

Spring JMS Activemq - set dead letter queue-name (DLQ)

吃可爱长大的小学妹 提交于 2020-01-02 04:07:12
问题 We have 3 different projects that are running on the same ACTIVEMQ broker. Currently there is a single "DLQ" queue, we would like to set the dlq for each web application like so: dlq_webapp1 dlq_webapp2 dlq_webapp3 This way we will have more control on the retry flow. how can we configure it to be like so? here are some of our messaging beans: <bean id="redeliveryConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="${activemq_url}" />

ClassCastException: javax.naming.Reference cannot be cast to javax.jms.ConnectionFactory

▼魔方 西西 提交于 2020-01-02 02:20:36
问题 I wrote a Java program to connect to Websphere MQ to publish messages. I created a JNDI namespace, connection factory, destinations, and queue manager in Websphere MQ Explore. When I am running my program it is showing ClassCastException for type casting from string to ConnectionFactory . Here is my code. Can anyone help resolve this problem. JNDIUtil.java package com.tradefinance.jms.util; //JMS classes import javax.jms.JMSException; import javax.jms.ConnectionFactory; import javax.jms

Putting Message in Websphere MQ via C# has different data length than manually putting the same message

ぐ巨炮叔叔 提交于 2020-01-02 02:19:26
问题 MQMessage queueMessage = new MQMessage(); queueMessage.WriteString(strInputMsg); queueMessage.Format = MQC.MQFMT_STRING; MQPutMessageOptions queuePutMessageOptions = new MQPutMessageOptions(); Queue.Put(queueMessage, queuePutMessageOptions); Using C#, with the above code, when I input the message into the queue, the data length of the message is 3600. When I manually input the message into the queue by right clicking the queue and selecting Put Test Message option, the data length of the

Server binding mode to connect Websphere MQ7 without WAS installed on the same server

限于喜欢 提交于 2020-01-01 15:32:20
问题 I've being trying to setup my java application that connects to a local queue manager in MQ7 without a WebSphere Application Server installed on my machine in binding mode. Without specifying the host in the .bindings file, running my application will throw an java exception somewhere along the lines of: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'TBUKKKNN' with connection mode 'Client' and host name ''. Check the queue manager is

Server binding mode to connect Websphere MQ7 without WAS installed on the same server

折月煮酒 提交于 2020-01-01 15:32:08
问题 I've being trying to setup my java application that connects to a local queue manager in MQ7 without a WebSphere Application Server installed on my machine in binding mode. Without specifying the host in the .bindings file, running my application will throw an java exception somewhere along the lines of: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'TBUKKKNN' with connection mode 'Client' and host name ''. Check the queue manager is

Where should I open / close JMS connections in a JSF ManagedBean?

百般思念 提交于 2020-01-01 12:01:09
问题 In a simple demo web app using JSF 2 and Ajax, there is a method in the ManagedBean which receives messages from a JMS queue: @ManagedBean public class Bean { @Resource(mappedName = "jms/HabariConnectionFactory") private ConnectionFactory connectionFactory; @Resource(mappedName = "jms/TOOL.DEFAULT") private Queue queue; public String getMessage() { String result = "no message"; try { Connection connection = connectionFactory.createConnection(); connection.start(); Session session = connection

Multithreaded JMS receiving in Spring

烈酒焚心 提交于 2020-01-01 11:47:09
问题 I'm trying to write a multithreaded implementation for JMS message processing from a queue. I've tried with DefaultMessageListenerContainer and SimpleMessageListenerContainer classes. The problem I have is that it seems like just a single instance of the MessageListener class gets ever instantiated, no matter how I configure it. This forces me to unnecessarily write stateless or thread-safe MessageListener implementations, since I have the ListenerContainer configured to use multiple threads

Multithreaded JMS receiving in Spring

做~自己de王妃 提交于 2020-01-01 11:47:05
问题 I'm trying to write a multithreaded implementation for JMS message processing from a queue. I've tried with DefaultMessageListenerContainer and SimpleMessageListenerContainer classes. The problem I have is that it seems like just a single instance of the MessageListener class gets ever instantiated, no matter how I configure it. This forces me to unnecessarily write stateless or thread-safe MessageListener implementations, since I have the ListenerContainer configured to use multiple threads