You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Eric Hubert (JIRA)" <ji...@apache.org> on 2009/03/18 12:15:50 UTC

[jira] Created: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Send Synapse generated Hessian faults with HTTP status 200
----------------------------------------------------------

                 Key: SYNAPSE-521
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-521
             Project: Synapse
          Issue Type: Improvement
          Components: Transports
    Affects Versions: 1.2
            Reporter: Eric Hubert
            Priority: Minor
             Fix For: 1.3


If synapse generates faults using the fault mediator using the nhttp transport they are currently always send using HTTP status 500. Hessian clients requires all messages to arrive with HTTP status 200 (no differentiation between normal messages and fault messages). HTTP 500 is reserved for real internal server errors.

The attached patch introduces a message context property to advice the nhttp transport to use a HTTP 200 status code. For the Hessian case the message builder set this advice and the HttpCoreNIOSender picks up this advice in case of fault messages. The logic to detect the proper HTTP status has been extracted to a separate private method to improve readability.

I think this approach is even better than the approach discussed on the dev list modifying the FaultMediator to set just another property with the value of the HTTP status. The FaultMediator stays transport independent and the property is directly evaluated from the transport.

Regarding the naming and place of the new Constants in NhttpConstants I would appreciate a review. The same applies to the extracted status code logic, which should not change the existing bahavior. I just tried to make it a bit more readable, also changing some comments.

Feedback welcome!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Resolved: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by Ruwan Linton <ru...@gmail.com>.
Well, what I meant is the complete functionality..... i.e. if HTTP_SC_OK is
set tot true write the 200 OK as the status code. People might be using this
in their configurations.

I am OK with just removing it though... :-)

Thanks,
Ruwan

On Sun, Mar 22, 2009 at 9:01 PM, Asankha C. Perera <as...@apache.org>wrote:

> Hi Ruwan
>
>> Well, even earlier we should have removed it, with th introduction of the
>> HTTP_SC property to the message..... but we kept that for the backward
>> compatibility...
>>
>> Don't we need to keep this as deprecated for this release?
>>
> This is just the constant declaration in the file that was removed..
> Personally I do not think this is serious enough to keep for backward
> compatibility in this case.
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Ruwan Linton
Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Re: [jira] Resolved: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Ruwan
> Well, even earlier we should have removed it, with th introduction of 
> the HTTP_SC property to the message..... but we kept that for the 
> backward compatibility...
>
> Don't we need to keep this as deprecated for this release?
This is just the constant declaration in the file that was removed.. 
Personally I do not think this is serious enough to keep for backward 
compatibility in this case.

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





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


Re: [jira] Resolved: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by Ruwan Linton <ru...@gmail.com>.
Well, even earlier we should have removed it, with th introduction of the
HTTP_SC property to the message..... but we kept that for the backward
compatibility...

Don't we need to keep this as deprecated for this release?

Thanks,
Ruwan

On Sat, Mar 21, 2009 at 1:30 PM, Hubert, Eric <Er...@foxmobile.com>wrote:

> Hi,
>
> It seems like we have a Jira downtime so I answer directly on the list.
>
> > Asankha C. Perera resolved SYNAPSE-521.
> > ---------------------------------------
> >
> >     Resolution: Fixed
> >       Assignee: Asankha C. Perera
> >
> > Thanks Eric for the fix. I just removed an unused constant "HTTP_SC_OK"
> > from the NhttpConstants
>
> Asankha, thanks for reviewing and committing and sorry about forgetting to
> remove the now unused constant. This has been a remaining of the alternative
> solution using the FaultMediator to set the HTTP 200 status code.
> With the latest approach it was possible to use the int constants of
> HttpStatus directly.
>
> Regards,
>    Eric
>



-- 
Ruwan Linton
Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

RE: [jira] Resolved: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by "Hubert, Eric" <Er...@foxmobile.com>.
Hi,

It seems like we have a Jira downtime so I answer directly on the list.

> Asankha C. Perera resolved SYNAPSE-521.
> ---------------------------------------
> 
>     Resolution: Fixed
>       Assignee: Asankha C. Perera
> 
> Thanks Eric for the fix. I just removed an unused constant "HTTP_SC_OK"
> from the NhttpConstants

Asankha, thanks for reviewing and committing and sorry about forgetting to remove the now unused constant. This has been a remaining of the alternative solution using the FaultMediator to set the HTTP 200 status code.
With the latest approach it was possible to use the int constants of HttpStatus directly. 

Regards,
   Eric

[jira] Updated: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by "Eric Hubert (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Hubert updated SYNAPSE-521:
--------------------------------

    Attachment: HessianFaultWithHttp200.patch

> Send Synapse generated Hessian faults with HTTP status 200
> ----------------------------------------------------------
>
>                 Key: SYNAPSE-521
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-521
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 1.2
>            Reporter: Eric Hubert
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: HessianFaultWithHttp200.patch
>
>
> If synapse generates faults using the fault mediator using the nhttp transport they are currently always send using HTTP status 500. Hessian clients requires all messages to arrive with HTTP status 200 (no differentiation between normal messages and fault messages). HTTP 500 is reserved for real internal server errors.
> The attached patch introduces a message context property to advice the nhttp transport to use a HTTP 200 status code. For the Hessian case the message builder set this advice and the HttpCoreNIOSender picks up this advice in case of fault messages. The logic to detect the proper HTTP status has been extracted to a separate private method to improve readability.
> I think this approach is even better than the approach discussed on the dev list modifying the FaultMediator to set just another property with the value of the HTTP status. The FaultMediator stays transport independent and the property is directly evaluated from the transport.
> Regarding the naming and place of the new Constants in NhttpConstants I would appreciate a review. The same applies to the extracted status code logic, which should not change the existing bahavior. I just tried to make it a bit more readable, also changing some comments.
> Feedback welcome!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (SYNAPSE-521) Send Synapse generated Hessian faults with HTTP status 200

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera resolved SYNAPSE-521.
---------------------------------------

    Resolution: Fixed
      Assignee: Asankha C. Perera

Thanks Eric for the fix. I just removed an unused constant "HTTP_SC_OK" from the NhttpConstants


> Send Synapse generated Hessian faults with HTTP status 200
> ----------------------------------------------------------
>
>                 Key: SYNAPSE-521
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-521
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 1.2
>            Reporter: Eric Hubert
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: HessianFaultWithHttp200.patch
>
>
> If synapse generates faults using the fault mediator using the nhttp transport they are currently always send using HTTP status 500. Hessian clients requires all messages to arrive with HTTP status 200 (no differentiation between normal messages and fault messages). HTTP 500 is reserved for real internal server errors.
> The attached patch introduces a message context property to advice the nhttp transport to use a HTTP 200 status code. For the Hessian case the message builder set this advice and the HttpCoreNIOSender picks up this advice in case of fault messages. The logic to detect the proper HTTP status has been extracted to a separate private method to improve readability.
> I think this approach is even better than the approach discussed on the dev list modifying the FaultMediator to set just another property with the value of the HTTP status. The FaultMediator stays transport independent and the property is directly evaluated from the transport.
> Regarding the naming and place of the new Constants in NhttpConstants I would appreciate a review. The same applies to the extracted status code logic, which should not change the existing bahavior. I just tried to make it a bit more readable, also changing some comments.
> Feedback welcome!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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