jms

JMSContext NullPointer Exception - wildfly 8.2.0 default queue

此生再无相见时 提交于 2019-12-25 04:53:23
问题 I am trying to send messages to my default queue in wildfly and when i invoke "sendMessage()" the JMSContext is giving me a null pointer exception. what can i fix ? public class SendMsg { @Resource(lookup = "java:/ConnectionFactory") ConnectionFactory connectionFactory; JMSContext context=connectionFactory.createContext(); @Resource(mappedName="java:/jms/queue/test") Queue queue; public void sendMessage(String message) { System.out.println("fancy beans"); context.createProducer().send(queue,

how to access activemq jms custom header property; from camel route

≯℡__Kan透↙ 提交于 2019-12-25 04:42:45
问题 Please see this question first. How can I access that custom header property value from "queue2"?outside of that route builder method or class. I am using something like shown below. I dont find any methods in consumerTemplate API to get custom header properties. ConsumerTemplate consumerTemplate = camelContext.createConsumerTemplate(); textMessage = consumerTemplate.receiveBody("activemq:queue2",10000,String.class); that question is to set header using camel route. but this question about

JMS publish rate is slow in SunOS

旧时模样 提交于 2019-12-25 04:19:24
问题 I have a application that uses JMS as messaging system. If publisher, subscriber and weblogic server is on Linux , publish rate is good enough(>30 messages/second). But if all the three are on SunOS , publish rate comes down to 2-3 messages/second . I tried to search internet but had no luck. Is there any know issue about that? What can be the reason of this strange behavior. 回答1: I found where the issue was in logs : Unable to load performance pack. Using Java I/O instead. Please ensure that

JMS topology (Queue with multiple consumers) and message groups

烂漫一生 提交于 2019-12-25 03:39:16
问题 here is a simplified / schematic topology we set up [Front server 1 (message producer)] [Front server n (message producer)] | | |________________ ________________| | | [Messaging Server (HornetQ)] | | ________________| |________________ | | [Task server 1 (Message Driven Bean)] [Task server n (MDB)] Each node (server) is a standalone (no cluster) jboss application server (Jboss-as7) including the messaging one. The messaging server deploys many JMS queues. Each Task server deploys a MDB per

Can Message driven beans (MDB) listen on “external” MQ?

萝らか妹 提交于 2019-12-25 03:03:04
问题 I am trying to understand concepts related to MDB, MQ, JMS. I did research on SO before asking this question. Is this possible scenario: MDB deployed on Application Server, say on JBOSS (on physical Server-A). MQ (say ApacheMQ) on a difference physical server-B. So can the MDB deployed in physical server-A get messages from physical server-B? If this is possible, then does MDB use JMS API's? I have heard Jboss has MQ, which i presume MQ withing Jboss application server; however i want MDB in

Message selector with receiveNoWait()

孤人 提交于 2019-12-25 02:47:06
问题 Will message selectors work with receiveNowait() method too for synchronous process. it works with receive() method but wanted to know for receiveNoWait for IBM mq. Message selector is added while creating consumer. EDIT 1: I have tested with receiveNowait() method, and the selector is not working. I don't know the problem is with my selector or the receivenowait method. following is the selector I have used: String messageSelector = "JMSTimestamp <= " + System.currentTimeMillis() - 180000;

Processing MQ ByteMessage using JMS client

落花浮王杯 提交于 2019-12-25 01:56:10
问题 I am using IBM MQ and Java to write a message as Bytes on to the queue. Problem here i am getting here is while reading this message from JMS client offcourse that is expected format,i am getting as "BytesMessage" instead of message in MQSTR format. What properties i have to set while writing the message on to the queue ,so JMS client consume that message as Text instead of Byte? Do i need to chnage any of the below properties or anything else? openOptions =MQC.MQOO_OUTPUT putOptions=MQC

Dynamically change jmsSelector

谁都会走 提交于 2019-12-24 22:18:28
问题 Is there a way to use a property read from a config file to fill propertyValue in JMS selector? As an example I have: @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = JMSSelector.ITEM_SELECTOR) Where JMSSelector.ITEM_SELECTOR is a String defined as: public static final String ITEM_SELECTOR = "type = 'S_TYPE' OR type = 'M_TYPE'" Let's say that I have another new type other than "S_TYPE" and "M_TYPE", and I have it in a config file MYTYPES = S_TYPE,M_TYPE,G_TYPE Is

JMS 2.0 - How to receive messages from topic with shared consumers?

偶尔善良 提交于 2019-12-24 21:05:12
问题 I am using ActiveMQ Artemis and JMS 2.0 for reading topic messages with shared consumers. I have two questions: Is there any way to use configuration with xml format. When I set the message listener on the consumer is it mandatory to use a while loop? If I don't use while (true) loop the program will terminate when topic has no messages. SharedConsumer.java public class SharedConsumer { @Resource(lookup = "java:comp/DefaultJMSConnectionFactory") ConnectionFactory connectionFactory; public

JMS: Server closed connection and reconnection not permitted

余生颓废 提交于 2019-12-24 19:16:58
问题 I want to count the messages in the queue. InitialContext ctx = initQueue(); connFactory = (QueueConnectionFactory) ctx.lookup(CF_NAME); queueConnection = connFactory.createQueueConnection(); queueConnection.start(); queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); queue = (Queue) ctx.lookup(queueName); QueueBrowser queueBrowser = queueSession.createBrowser(queue); But here it stops ------->QueueBrowser queueBrowser = queueSession.createBrowser(queue)