4 Replies Latest reply on Jul 30, 2009 4:23 AM by kconner

    HTTP response (status) codes should be returned through rele

    dward

      Here is the JIRA link: https://jira.jboss.org/jira/browse/JBESB-2761.

      "When the <jbr-provider/> (JBossRemotingGatewayListener using http protocol) or <http-provider/> (HttpGatewayListener) is used in a synchronous fashion, HTTP response (status) codes should be returned when there are "proxied" HTTP actions in the service's pipeline. This includes HttpRouter, SOAPClient, SOAPProcessor and SOAPProxy.

      This is similar to JBESB-2511, where response headers weren't always being propagated back, but now we're talking about the response (status) code."

      I have made the minor fixes necessary in my working copy of trunk, but before I commit them, would like some feedback. A few comments/questions:

      1) Comment: The fix for this is quite simple: Just make sure that in the relavant actions, a Message property is set with the status code. For <jbr-provider/>, it means setting the HTTPMetadataConstants.RESPONSE_CODE property so that the JBossRemotingMessageComposer can pick it up. For <http-provider, it means setting the HttpMessageComposer.HTTP_RESPONSE_STATUS property so that the HttpMessageComposer can pick it up.

      2) Comment: It should be noted that the *last* action in a pipeline will "win" with regards to the response code. So, say you had a HttpRouter action that sets the property with a 401 code, but then a SOAPClient action that sets it with a 200 code, the 200 would clobber the 401, and thus 200 would get returned to the client.

      3) Question: As this is a change to current functionality, should we make a boolean property available (local to the action and/or global to the bus) which activates or deactivates this "feature"? It feels more like it was an oversight (bug) to me, but still, I don't want to change the status quo if it's going to mess people up... Maybe since the SOAPProxy is so new, it's default behavior would be to return the status code, but for SOAPClient and SOAPProcessor, it doesn't unless you enable it?

      4) Question: I was able to change the stanard SOAPClient, but not the wise SOAPClient. There just wasn't an API available to me where I could do this. Should this be a new JIRA item just for the wise SOAPClient?

      Thanks!

        • 1. Re: HTTP response (status) codes should be returned through
          dward

          The Subject got chopped. It should have read "HTTP response (status) codes should be returned through relevant gateways"

          • 2. Re: HTTP response (status) codes should be returned through
            dward

            I'm starting to think that this was wrong behavior to begin with (it was a bug), so I think the default for everything is to return the response code. It should be overrideable at an action level via a property, and globally in the "transports" section of jbossesb-properties.xml.

            • 3. Re: HTTP response (status) codes should be returned through
              dward

              I didn't hear any feedback, so I went ahead and made this change.

              The default for SOAPClient, SOAPProducer, SOAPProxy and HttpRouter is now such that their response status will get returned by either the JBossRemotingGatewayListener and/or the HttpGatewayListener.

              If you want the legacy behavior, you can override this at an action level (META-INF/jboss-esb.xml):

              <action name="..." class="...">
               <property name="http.responseStatusEnabled" value="false"/>
              </action>


              or at a global level (jbossesb-properties.xml):
              <esb>
               <properties name="transports">
               <property name="org.jboss.soa.esb.http.responseStatusEnabled" value="false"/>
               </properties>
              </esb>


              Again, the default is now true. I still have to update the docs about this.

              • 4. Re: HTTP response (status) codes should be returned through
                kconner

                 

                "dward" wrote:
                I didn't hear any feedback, so I went ahead and made this change.

                You didn't hear feedback from me because I *thought* you were doing performance work and not this. I thought that I had time to finish my tasks first :)

                "dward" wrote:
                The default for SOAPClient, SOAPProducer, SOAPProxy and HttpRouter is now such that their response status will get returned by either the JBossRemotingGatewayListener and/or the HttpGatewayListener.

                ...

                Again, the default is now true. I still have to update the docs about this.

                We should also make sure that something gets highlighted in the release notes, I'll create a task for it.

                Kev