天道酬勤,学无止境

jms

Priority with activemq

We're currentyly developping an application using JMS and activemq (5.5.1). We would like to define a higher priority for some messages, which would make them consumed first. After setting the producer and the consumer (through spring (3.1) JMSTemplate), the priority does not fully work. Indeed, when we "turn off" the consumer, and send some messages, the priority is respected, but when we add messages while the consumer is on, the messages are received in the same order they were sent. The configuration is quite simple: Priority was activated in the activemq config file: <policyEntries>

2021-06-15 13:33:14    分类:问答    java   spring   jms   activemq

IBM MQ Message Listener

Hi does anyone know how to create a message listener using IBM MQ? I know how to do it using the JMS spec but I am not sure how to do it for IBM MQ. Any links or pointers are greatly appreciated.

2021-06-15 07:34:02    分类:问答    java   jms   ibm-mq

@RequestScoped CDI injection into @MessageDriven bean

If I have a request scoped CDI bean injected into a @MessageDriven EJB using JMS, as below, can I assume that any given Foo instance will only be used by a single onMessage invocation at a time? In other words, in the below example, can I safely use member variables in the Foo object to store state across subroutines, analogously to a JSF @RequestScoped managed bean? Note that it's ok if the same Foo object gets recycled sequentially from one onMessage call to the next, as long as each MessageDrivenBean instance has its own Foo instance such that two requests processing concurrently would be

2021-06-15 03:16:21    分类:问答    jakarta-ee   jms   java-ee-6   cdi   message-driven-bean

HornetQ JMSException: Failed to create session factory

I'm trying to Directly instantiating JMS Resources without using JNDI to a REMOTE HORNETQ. I am running my test code in Eclipse IDE. Setup my classpath to use the HornetQ 2.2.5 libraries. The target HornetQ is version 2.1.2.Final, I figured they should be backwards compatible, maybe im wrong? Okay, so I have read the online documentation and followed the examples on connecting to a remote JMS server without using JNDI. I keep on getting the following exception. Im not sure what Im missing but I believe I have everything setup correctly. Could someone please point out what Im missing here

2021-06-14 18:57:56    分类:问答    jms   hornetq

ActiveMQ How to handle closed session

I am using ActiveMQ to enqueue email messages, the consumer reads the queue and sends out emails. At startup, I register a producer and cache it forever. PooledConnectionFactory factory = new PooledConnectionFactory(new ActiveMQConnectionFactory(jmsBrokerUserName, jmsBrokerPassword, activeMQBrokerURL)); Connection connection = factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Destination destination = session.createQueue(queueName); MessageProducer producer = session.createProducer(destination); From time to time, the producer fails to

2021-06-14 12:45:44    分类:问答    jms   activemq

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

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 message is 1799. I am really confused why this is the case. The message in both cases is an xml string with

2021-06-14 09:26:13    分类:问答    c#   xml   jms   ibm-mq

Exception: Need to specify class name in environment or system property: java.naming.factory.initial [duplicate]

This question already has answers here: The meaning of NoInitialContextException error (12 answers) Closed 8 years ago. When i run a JMS related application, i am encountering the following exception error. javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial We are using Sun Application Server 9.1 Any idea what are we missing? I already tried adding the following but result still the same Properties env = new Properties(); env.put("java.naming.factory

2021-06-14 04:12:22    分类:问答    jms

How can I change default port number of Activemq

I am using Windows 7 OS. I downloaded apache-activemq-5.8.0.zip from these Link and extracted in C:\Users\Infratab Bangalore\Desktop\Queueing\apache-activemq-5.8.0 directory. While Activemq initialization time I read Pre-Installation Requirements concept from these Link. I already installed apache-maven-3.0.5 in my system.For my conformation I run the following command in my system. mvn -version I am getting the following message,So Maven is installed successfully. Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21: 28+0530) Maven home: P:\Software\apache-maven-3.0

2021-06-13 15:31:21    分类:问答    java   apache   jms   activemq   java-ee-7

Is “fair queuing” possible with JMS

I need to implement a fair queuing system such that messages are processed in a round robin fashion, based on the value of some message header, for all values of that header on messages currently queued. Messages in the system are naturally grouped by some property, of which there are many thousands of possible values and the set of values for messages currently queued changes over time. An analogy would be messages having a header which is the milliseconds part of the time, at the time of message creation. Thus, the header will have a value between 0 and 999, and there will be some

2021-06-13 14:27:56    分类:问答    jms   hornetq

NoClassDefFoundError (initialization failure) - Websphere and IBM MQ

Im having a problem on a Spring based webapp that is being deployed to Websphere and interacts with IBM MQ. All is fine until I try some failure tests. While the webapp is up and running, I stop IBM MQ. I then invoke the webapp to send a JMS message out. The webapp hung at the call to JmsTemplate.convertAndSend and the following exception was found in the ffdc directory. Note the JmsTemplate was initialised using the JNDIObjectFactoryBean where it had got the MQ Connection Factory settings from Websphere. Can anyone explain the reason behind the "Initializaton Failure" ?? [27/01/11 14:29:39

2021-06-13 13:00:19    分类:问答    java   spring   jms   websphere   ibm-mq