History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: HJMS-11
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Colin Crist
Reporter: Bernhard Neuhauser
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
HermesJMS

Send TextMessage leads to Unsupported priority '-1': priority must be from 0-10

Created: 10/Jan/07 03:06 AM   Updated: 21/Sep/11 04:01 PM
Component/s: None
Affects Version/s: 1.12
Fix Version/s: 1.12

Environment:
Tested with JRE 1.5.0_09-b03 and 1.6.0-b105
Hermes 1.12 Snapshot from http://hermesjms.com/patches/ 2007_01_09


 Description  « Hide
  1) select a jms topic (jms => sessions => session => topic)
  2) Messages =>send ... => send TextMessage
  3) select textfile => send
  
Leads to the following error:
JMSException: Unsupported priority '-1': priority must be from 0-10

Seems to be v1.12 related and not a side affect of JRE 6.

 All   Comments   Change History      Sort Order:
Colin Crist [10/Jan/07 09:19 AM]
Whats your JMS provider? Is this something that used to work for you in a previous version? Can you provide a stack trace? Look in the About box to find out where you're logging to.

I've just tested with ActiveMQ and EMS and they both work - ActiveMQ has a default JMSPriority of 0 and EMS defaults to 4.

Hermes does not set the priority when sending text messages from files as can be seen in the invoke() method here:

http://hermesjms.cvs.sourceforge.net/hermesjms/Hermes4/src/java/hermes/browser/tasks/SendMessageTask.java?view=markup

which calls Hermes.createTextMessage() which is implemented here (line 294):

http://hermesjms.cvs.sourceforge.net/hermesjms/Hermes4/src/java/hermes/impl/DefaultHermesImpl.java?view=markup

btw, I've just updated the SNAPSHOT to include http://hermesjms.com/jira/browse/HJMS-12 which may help you


Bernhard Neuhauser [11/Jan/07 03:21 AM]
Verified your latest snapshot. Got the same behavior.

Digged little bit into your sources. I think that the cause of my problem is that you changed line 607 in
http://hermesjms.cvs.sourceforge.net/hermesjms/Hermes4/src/java/hermes/impl/DefaultHermesImpl.java?revision=1.41&view=markup

from
> sender.send((Queue) d, m);
to
> sender.send((Queue) d, m, m.getJMSDeliveryMode(), m.getJMSPriority(), m.getJMSExpiration());

Currently im using the default jms from jboss AS 4.0.5, which is JbossMQ.

A little StandaloneTest with jbossMQ:
> System.out.println("default priority = " + session.createTextMessage().getJMSPriority());
leads to
> default priority = -1

p.s. subversion would be neat - easy to check out sources behind a firewall.

Colin Crist [11/Jan/07 04:11 AM]
I see, so getJMSPriority() on an unsent JBossMQ message that has not had its priority explicitly set returns an invalid priority.

I've changed the code so that it will set a priority of 0 if getJMSPriority() < 0 and a TTL of 0 if getJMSExpiration() < 0 as well for good measure and pushed out a new snapshot. A quick test before and after this change with JBoss 4.0.3 shows the issues and that this fixes it.

I've been meaning to subversion for a while now, I've added an issue to JIRA for it...









Bernhard Neuhauser [11/Jan/07 05:25 AM]
:o) works well with your latest Snapshot.

thx for your effort