You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by GitBox <gi...@apache.org> on 2020/03/28 16:51:46 UTC

[GitHub] [synapse] shafreenAnfar opened a new pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes

shafreenAnfar opened a new pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes
URL: https://github.com/apache/synapse/pull/32
 
 
   At the moment, current MFP implementation does not support retrying based on HTTP status codes. It only supports retrying for transport level failures but not for application level failures. As you know, in HTTP protocol, application level failures are distinguished using different status codes. In the case of MFP, it is important to be able to retry for 5xx server errors. But there also could be rare occasions in which retrying for 4xx and 3xx are useful. Especially when dealing with servers that do not follow HTTP protocol exactly as it is.
   
   Therefore, I have improved MFP implementation to support retrying based on the returned HTTP status code as well. Say, a user wants to retry for HTTP status codes 500 and 504 but not for any other HTTP status code. In that case user can configure the MFP as below. Please note the parameter in bold font which I have introduced along with this feature. 
   
   ```xml
   <messageProcessor xmlns="http://ws.apache.org/ns/synapse"     
    class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
                     name="Processor2"
                     messageStore="JMSMS">
      <parameter name="max.delivery.attempts">4</parameter>
      <parameter name="message.processor.reply.sequence">replySequence</parameter>
      <parameter name="interval">1000</parameter>
      <parameter name="retry.http.status.codes">500, 504</parameter>
   </messageProcessor>
   ```
   Please not that the above parameter does not come to effect in case of out-only. Once this is merged, I am planning to send another PR for the required documentation changes. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [synapse] isudana commented on a change in pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes

Posted by GitBox <gi...@apache.org>.
isudana commented on a change in pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes
URL: https://github.com/apache/synapse/pull/32#discussion_r400340740
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
 ##########
 @@ -412,6 +412,9 @@
 
     public static final String HTTP_SENDER_STATUSCODE = "transport.http.statusCode";
 
+    public static final String HTTP_INTERNAL_SERVER_ERROR = "500";
+    public static final String HTTP_BAD_REQUEST_ERROR = "400";
+
 
 Review comment:
   +1, let's move this to MessageProcessorConsents

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [synapse] shafreenAnfar commented on issue #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes

Posted by GitBox <gi...@apache.org>.
shafreenAnfar commented on issue #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes
URL: https://github.com/apache/synapse/pull/32#issuecomment-606358193
 
 
   Btw, do let me know if there is way to write a solid test-case for this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [synapse] shafreenAnfar commented on a change in pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes

Posted by GitBox <gi...@apache.org>.
shafreenAnfar commented on a change in pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes
URL: https://github.com/apache/synapse/pull/32#discussion_r399756268
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
 ##########
 @@ -412,6 +412,9 @@
 
     public static final String HTTP_SENDER_STATUSCODE = "transport.http.statusCode";
 
+    public static final String HTTP_INTERNAL_SERVER_ERROR = "500";
+    public static final String HTTP_BAD_REQUEST_ERROR = "400";
+
 
 Review comment:
   If needed I can move this to MessageProcessorConsents class as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [synapse] isudana merged pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes

Posted by GitBox <gi...@apache.org>.
isudana merged pull request #32: Improve Message Forwarding Processor (MFP) to support HTTP status codes
URL: https://github.com/apache/synapse/pull/32
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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