Synapse
  1. Synapse
  2. SYNAPSE-259

Adds ability to exchange messages in hessian format

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: Core
    • Labels:
      None
    • Environment:
      JDK 1.5

      Description

      Hessian messages can be exchanged through Synapse. Content based on HTTp headers can be done but routing based on the Hessian message cannot be done.

      1. hessian-src.zip
        6 kB
        Tharindu Mathew

        Issue Links

          Activity

          Hide
          Tharindu Mathew added a comment -

          With this patch Hessian messages can be exchanged through Synapse.

          Show
          Tharindu Mathew added a comment - With this patch Hessian messages can be exchanged through Synapse.
          Hide
          Ruwan Linton added a comment -

          Good piece of work Tharindu, I think we need to improve this a little bit to support large hessian messages. (currently there seem to be a limit of 1024 x 8 for the message size)

          Also I think we need to change the package name because this is going to reside in the synapse svn till this stabilizes. Where should this go? I propose the package name org.apache.synapse.format.hessian inside the transport module...

          devs, WDYT?

          Show
          Ruwan Linton added a comment - Good piece of work Tharindu, I think we need to improve this a little bit to support large hessian messages. (currently there seem to be a limit of 1024 x 8 for the message size) Also I think we need to change the package name because this is going to reside in the synapse svn till this stabilizes. Where should this go? I propose the package name org.apache.synapse.format.hessian inside the transport module... devs, WDYT?
          Hide
          Tharindu Mathew added a comment -

          Yes, I thought the problem would be solved by enabling File caching in the axis2.xml. THe thing is handling large payloads has been already handled by using File caching in MTOM. Is it possible to plug into this method, without re-inventing the wheel?

          Show
          Tharindu Mathew added a comment - Yes, I thought the problem would be solved by enabling File caching in the axis2.xml. THe thing is handling large payloads has been already handled by using File caching in MTOM. Is it possible to plug into this method, without re-inventing the wheel?
          Hide
          Ruwan Linton added a comment -

          Tharindu,

          I think we need to get rid of the HessianDataSource and use the BynaryArrayDataSource and the CachedFileDataSource from axiom.

          Well you cannot expect anything to work without testing it (for example by enabling caching in the axis2.xml, you cannot expect this to work for large messages. According to the logic of the code there is no way that it is going to work )

          Show
          Ruwan Linton added a comment - Tharindu, I think we need to get rid of the HessianDataSource and use the BynaryArrayDataSource and the CachedFileDataSource from axiom. Well you cannot expect anything to work without testing it (for example by enabling caching in the axis2.xml, you cannot expect this to work for large messages. According to the logic of the code there is no way that it is going to work )
          Hide
          Ruwan Linton added a comment -

          Tharindu,

          May be I am wrong here, but to my little knowledge on hessian, we cannot reuse the MTOM code here, but just the approach. This is because MTOM treats attachments where as a hessian message is not a SOAP attachment, isn't it?

          We can use the idea, so no need to reinvent the wheel, but it has to be a different form of a wheel and we need to design that specific wheel.

          Show
          Ruwan Linton added a comment - Tharindu, May be I am wrong here, but to my little knowledge on hessian, we cannot reuse the MTOM code here, but just the approach. This is because MTOM treats attachments where as a hessian message is not a SOAP attachment, isn't it? We can use the idea, so no need to reinvent the wheel, but it has to be a different form of a wheel and we need to design that specific wheel.
          Hide
          Thilina Gunarathne added a comment -

          hmm... I don't think Axis2 file caching would work, as it works under the cover of MIME parser... So it'll work only if the Message is a MIME/Multipart message.

          You guys would need to write a similar miniature mechanism for that. Have a look at the getPart() method of the Attachment class..

          Show
          Thilina Gunarathne added a comment - hmm... I don't think Axis2 file caching would work, as it works under the cover of MIME parser... So it'll work only if the Message is a MIME/Multipart message. You guys would need to write a similar miniature mechanism for that. Have a look at the getPart() method of the Attachment class..
          Hide
          Ruwan Linton added a comment -

          Thanks Thilina for the input and I have used a class added by Andreas on XSLT processing TempararyData to handle the large messages. Thanks Andreas for the timely contribution of the TempararyData class, it really helped me to solve the issue with Hessian large messages.

          Show
          Ruwan Linton added a comment - Thanks Thilina for the input and I have used a class added by Andreas on XSLT processing TempararyData to handle the large messages. Thanks Andreas for the timely contribution of the TempararyData class, it really helped me to solve the issue with Hessian large messages.
          Hide
          Ruwan Linton added a comment -

          Fixed, but need to test the fault handling

          Show
          Ruwan Linton added a comment - Fixed, but need to test the fault handling
          Hide
          Andreas Veithen added a comment -

          Ah... this was the wheel you were looking for...

          We will probably need a DataSource implementation backed by a TemporaryData object elsewhere in Synapse, so maybe I will refactor HessianDataSouce into something more generic in the future.

          I changed the Hessian dependencies because they were not available from the repositories declared in the Synapse project and I was not able to build. Please check if the new dependencies are acceptable.

          For the fault handling, shouldn't HessianMessageFormatter use HessianOutput#writeFault instead of HessianOutput#writeString? I'm not familiar at all with Hessian, but this seems strange to me.

          Show
          Andreas Veithen added a comment - Ah... this was the wheel you were looking for... We will probably need a DataSource implementation backed by a TemporaryData object elsewhere in Synapse, so maybe I will refactor HessianDataSouce into something more generic in the future. I changed the Hessian dependencies because they were not available from the repositories declared in the Synapse project and I was not able to build. Please check if the new dependencies are acceptable. For the fault handling, shouldn't HessianMessageFormatter use HessianOutput#writeFault instead of HessianOutput#writeString? I'm not familiar at all with Hessian, but this seems strange to me.
          Hide
          Ruwan Linton added a comment -

          Thanks, I also think a generic DataSource backed by TempararyData will add much value to various parts of synapse

          BTW: I managed to get the latests artifacts into wso2 repo, which is a repository in the synapse pom. I will change the dependency to that. I think I have added hessian to the groupId mistakenly, which is the artifactId

          I have to look at the fault handling at a little deeper, because it seems sometimes the hessian fault comes as html to which synapse fails to pass.

          Show
          Ruwan Linton added a comment - Thanks, I also think a generic DataSource backed by TempararyData will add much value to various parts of synapse BTW: I managed to get the latests artifacts into wso2 repo, which is a repository in the synapse pom. I will change the dependency to that. I think I have added hessian to the groupId mistakenly, which is the artifactId I have to look at the fault handling at a little deeper, because it seems sometimes the hessian fault comes as html to which synapse fails to pass.

            People

            • Assignee:
              Ruwan Linton
              Reporter:
              Tharindu Mathew
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development