james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1023960 - /james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
Date Mon, 18 Oct 2010 19:21:07 GMT
Author: norman
Date: Mon Oct 18 19:21:07 2010
New Revision: 1023960

URL: http://svn.apache.org/viewvc?rev=1023960&view=rev
Log:
Use -1 as mark for messages which should get consumed asap

Modified:
    james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java

Modified: james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java?rev=1023960&r1=1023959&r2=1023960&view=diff
==============================================================================
--- james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
(original)
+++ james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
Mon Oct 18 19:21:07 2010
@@ -264,7 +264,7 @@ public class JMSMailQueue implements Mai
      * @see org.apache.james.queue.MailQueue#enQueue(org.apache.mailet.Mail)
      */
     public void enQueue(Mail mail) throws MailQueueException {
-        enQueue(mail, 0, TimeUnit.MILLISECONDS);
+        enQueue(mail, -1, TimeUnit.MILLISECONDS);
     }
 
     /**
@@ -281,7 +281,7 @@ public class JMSMailQueue implements Mai
     protected Message createMessage(Session session, Mail mail, long delayInMillis) throws
JMSException, MessagingException, IOException {
         BytesMessage message = session.createBytesMessage();
         mail.getMessage().writeTo(new BytesMessageOutputStream(message));
-        ;
+        
         return message;
     }
 
@@ -296,7 +296,11 @@ public class JMSMailQueue implements Mai
      */
     @SuppressWarnings("unchecked")
     protected void populateJMSProperties(Message message, Mail mail, long delayInMillis)
throws JMSException, MessagingException {
-        long nextDelivery = System.currentTimeMillis() + delayInMillis;
+        long nextDelivery = -1;
+        if (delayInMillis > 0) {
+            nextDelivery = System.currentTimeMillis() + delayInMillis;
+
+        }
         message.setLongProperty(JAMES_NEXT_DELIVERY, nextDelivery);
         message.setStringProperty(JAMES_MAIL_ERROR_MESSAGE, mail.getErrorMessage());
         message.setLongProperty(JAMES_MAIL_LAST_UPDATED, mail.getLastUpdated().getTime());



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message