I am evaluating JBoss 4.2.2 and JBoss Messaging 1.4.0SP3. When using MessageConsumer with a messageSelector, the communication hangs.
Outside JBossAS the inspector indicates a SpyObjectMessage while inside the container a JbossObjectMessage is used.
SpyObjectMessage is a class from JBossMQ, not JBoss Messaging.
Are you sure you're using JBoss Messaging outside the container?
2.) Is there a difference in these lines or are they equivalent?
msg.setJMSCorrelationID(correlationId); // 1
msg.setStringProperty("JMSCorrelationID", correlationId ); //2
#2 is not legal: you're not allowed to start the name of a property by "JMS".
JMSCorrelationID must be set using #1 to work
hope it helps,
Thanks for the hint!
Probably the client classpath (outside) jboss contains a wrong jar, i will check it.
What about the behavior inside the container? JBossObjectMessage seems to be the right one. After setting JMSCorrelationID the object contains (in debugger) the header property. Any idea, how the information is lost on way to the consument? jbossmq.jar is not in the jboss-classpath (recursive search over whole folder).
The JBossMessaging is installed as described in the instructions.
Note: MDBs are well running, the problems only occur when using direct jms access. (jms client).
After installing, please run the examples as explained in the user guide.
If they don't all run successfully that means your installation was botched.
In which case you would need to re-install.
The example runs without trouble.
I used the example for my eclipse testclient. As noted, my test-client used the the wrong classpath, i will verify this. Primary goal to get jboss messaging running inside the container.
The message driven beans work fine. Also my jms-client works in general. In my opinion the defect affects message headers only. So receiving without selector works, too.
Any idea, why the receive fails?
How can i find out, what goes wrong? Are there special log entries?
The ObjectMessage is stored to an oracle database, but the header fields are of type blob, so a can't take a look into.
Sounds like your selector is just wrong, where are you setting JMSType="java.lang.String"?
Please post a simple java example demonstrating the problem (both sender and receiver).
I tried it again and reinstalled jboss 4.2.2.GA with messaging. After that it look a bit different. First of all, the consumers receive the messages. But they don't receive immediatelly, they wait up to nearly timeout seconds.
Message msg = MessageConsumer.receive(60000);
Sometimes the call returns immediatelly, but sometime it takes up to timeout seconds. I created a simle test-app, doing the same. This test-app does not hang.
The process flow is following:
thread-1: send to queue A
receive( queue B, by selector, timeout );
thread-2: Message Driven Bean
// do somehing
send response to queue B
// do something more
The original code is based on ejb2.x Mdb and causes hangs. My sample App uses an Ejb3 Mdb.
After doSend() is see an entry in JBM_MSG table. So i think to jms operation is successfull commited, isn't?
Solved! The problematic code was instantiated several times, so at least one jms-session per request was created. Seems this blocks the queue for a while, because the other (old) session processes the request and puts it back (no consumer) after a specific period.