You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/03/07 17:26:31 UTC

svn commit: r920026 - /james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/

Author: norman
Date: Sun Mar  7 16:26:30 2010
New Revision: 920026

URL: http://svn.apache.org/viewvc?rev=920026&view=rev
Log:
Some more work related to JAMES-977

Added:
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/RemoteDeliveryRecipientList.java
Removed:
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailDeliveryDelayer.java
Modified:
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingComponent.java
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingConsumer.java
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingEndpoint.java
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/JamesCamelConstants.java

Modified: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingComponent.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingComponent.java?rev=920026&r1=920025&r2=920026&view=diff
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingComponent.java (original)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingComponent.java Sun Mar  7 16:26:30 2010
@@ -29,6 +29,7 @@
  */
 public class ActiveMQPollingComponent extends DefaultComponent{
 
+	
     @Override
     protected Endpoint createEndpoint(String uri, String arg1, Map<String, Object> arg2) throws Exception {
         return new ActiveMQPollingEndpoint(uri, this);

Modified: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingConsumer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingConsumer.java?rev=920026&r1=920025&r2=920026&view=diff
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingConsumer.java (original)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingConsumer.java Sun Mar  7 16:26:30 2010
@@ -36,25 +36,24 @@
 public class ActiveMQPollingConsumer extends ScheduledPollConsumer{
 
     private ConsumerTemplate consumerTemplate;
-    private String receiveEndpointUri;
+	private String uri;
     
     public ActiveMQPollingConsumer(DefaultEndpoint endpoint, Processor processor, ConsumerTemplate consumerTemplate) {
         super(endpoint, processor);
         this.consumerTemplate = consumerTemplate;
-        receiveEndpointUri = getEndpoint().getEndpointUri().replace(getEndpoint().getEndpointKey(),"activemq");
- 
     }
   
+    public void setEndpointUri(String uri) {
+    	this.uri = uri;
+    }
+    
     @Override
     protected void poll() throws Exception {
       
         StringBuffer consumerUri = new StringBuffer();
-        consumerUri.append(receiveEndpointUri);
-        if (receiveEndpointUri.indexOf("?") > -1) {
-            consumerUri.append("&");
-        } else {
-            consumerUri.append("?");
-        }
+        consumerUri.append(uri);
+        consumerUri.append("?");
+        
         consumerUri.append("selector=");
         consumerUri.append(JamesCamelConstants.JAMES_NEXT_DELIVERY);
         consumerUri.append("<");

Modified: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingEndpoint.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingEndpoint.java?rev=920026&r1=920025&r2=920026&view=diff
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingEndpoint.java (original)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/ActiveMQPollingEndpoint.java Sun Mar  7 16:26:30 2010
@@ -19,6 +19,8 @@
 
 package org.apache.james.transport.camel;
 
+import java.util.Map;
+
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
@@ -53,4 +55,11 @@
         return consumer;
     }
 
+	@Override
+	public boolean isLenientProperties() {
+		return true;
+	}
+    
+    
+
 }

Modified: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/JamesCamelConstants.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/JamesCamelConstants.java?rev=920026&r1=920025&r2=920026&view=diff
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/JamesCamelConstants.java (original)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/JamesCamelConstants.java Sun Mar  7 16:26:30 2010
@@ -30,5 +30,10 @@
      */
     public final static String JAMES_NEXT_DELIVERY = "JAMES_NEXT_DELIVERY";
 
+    /**
+     * Property which should be set to true if the mail should get sent again
+     */
+    public final static String JAMES_RETRY_DELIVERY = "JAMES_RETRY_DELIVERY";
+
 
 }

Added: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/RemoteDeliveryRecipientList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/RemoteDeliveryRecipientList.java?rev=920026&view=auto
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/RemoteDeliveryRecipientList.java (added)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/RemoteDeliveryRecipientList.java Sun Mar  7 16:26:30 2010
@@ -0,0 +1,35 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.camel;
+
+import org.apache.camel.Body;
+import org.apache.camel.Property;
+import org.apache.mailet.Mail;
+
+
+public class RemoteDeliveryRecipientList {
+	
+	public final static String JAMES_OUTGOING_QUEUE = "JAMES_OUTGOING_QUEUE";
+	
+	public String to(@Property(JAMES_OUTGOING_QUEUE) String outgoing, @Body Mail mail) {
+		Integer retry = Integer.parseInt(mail.getErrorMessage());
+		return "activemq:queue:"+outgoing+"." +retry;
+	}
+}



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