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

Key: QUARTZ-539
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: James House
Reporter: Toni Alatalo
Votes: 0
Watchers: 1
Operations

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

Bugs in JMS SendQueueMessageJob

Created: 01/Dec/06 06:39 AM   Updated: 27/Aug/07 08:57 PM
Component/s: Jobs
Affects Version/s: 1.6
Fix Version/s: 1.6.1

File Attachments: 1. Text File QUARTZ-539-fix.patch (1 kb)
2. Text File SendQueueMessageJob.patch (2 kb)


Flags: Patch


 Description  « Hide
jobs.ee.jms.SendQueueMessageJob has some simple bugs. i fixed them to match the original intent as well as could see it, is pretty trivial so probably got it right - seems to be working fine. thanks for the original author for providing this! it is a bit strange though that clearly completely untested code has been put to CVS and released.

i have not used JIRA before so don't know if this will let me attach a patch later in the process, so am putting the diff here just in case:

Index: src/java/org/quartz/jobs/ee/jms/SendQueueMessageJob.java
===================================================================
RCS file: /cvs/quartz/src/java/org/quartz/jobs/ee/jms/SendQueueMessageJob.java,v
retrieving revision 1.2
diff -u -r1.2 SendQueueMessageJob.java
--- src/java/org/quartz/jobs/ee/jms/SendQueueMessageJob.java 13 Jul 2006 10:40:53 -0000 1.2
+++ src/java/org/quartz/jobs/ee/jms/SendQueueMessageJob.java 1 Dec 2006 12:20:52 -0000
@@ -70,7 +70,7 @@
 *
 * @see JmsMessageFactory
 *
-* @author Weston M. Price
+* @author Weston M. Price (little fixes v. in 1.6.0 by Toni Alatalo)
 *
 *
 */
@@ -91,9 +91,11 @@
         final JobDataMap jobDataMap = detail.getJobDataMap();
         
         try {
-
             ctx = JmsHelper.getInitialContext(jobDataMap);
             
+ qcf = (QueueConnectionFactory) ctx
+ .lookup(jobDataMap.getString(JmsHelper.JMS_CONNECTION_FACTORY_JNDI));
+
             if(JmsHelper.isDestinationSecure(jobDataMap)) {
                 String user = jobDataMap.getString(JmsHelper.JMS_USER);
                 String pw = jobDataMap.getString(JmsHelper.JMS_PASSWORD);
@@ -105,7 +107,7 @@
             boolean useTransactions = JmsHelper.useTransaction(jobDataMap);
             int ackMode = jobDataMap.getInt(JmsHelper.JMS_ACK_MODE);
             session = conn.createQueueSession(useTransactions, ackMode);
- queue = (Queue)ctx.lookup(JmsHelper.JMS_DESTINATION_JNDI);
+ queue = (Queue)ctx.lookup(jobDataMap.getString(JmsHelper.JMS_DESTINATION_JNDI));
             sender = session.createSender(queue);
             String factoryClass = jobDataMap.getString(JmsHelper.JMS_MSG_FACTORY_CLASS_NAME);
             JmsMessageFactory factory = JmsHelper.getMessageFactory(factoryClass);


 All   Comments   Change History      Sort Order:
Toni Alatalo - [01/Dec/06 06:52 AM ]
fixes to the little bugs in SendQueueMessageJob

Henri Yandell - [15/Jan/07 12:36 AM ]
Attaching Toni's fix as a patch file.

Henri Yandell - [15/Jan/07 12:37 AM ]
Sorry Toni, didn't notice you'd attached the patch already. Ignore my patch and treat this as a "Visual confirmation of patch - and compiles for me".

Henri Yandell - [12/Mar/07 07:16 PM ]
Given how broken this bit was, I suspect the whole JMS component needs some testing. Something a friend and I made a while back was a simple in-memory JMS implementation. It might be useful for testing.

http://osjava.googlecode.com/svn/trunk/simple-jms/

We'd have to release it of course :)

James House - [16/Mar/07 11:23 PM ]
This donation of JMS-related code came from some folks at JBoss.... should have known it wouldn't be solid ;-)

Henri Yandell - [21/Mar/07 12:21 AM ]
svn ci -m "Applying the patch from QUARTZ-539. Thanks Toni" src/
Sending src/java/org/quartz/jobs/ee/jms/SendQueueMessageJob.java
Transmitting file data .
Committed revision 675.

And r676 on the branch.

Weston M. Price - [27/Aug/07 08:57 PM ]
I should have caught this...regardless of place of employment :-)