You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Soumadeep <so...@infravio.com> on 2006/02/13 11:36:38 UTC

Mediators exposed as samples!

Hi Paul,

Hope you are doing great.

I was wondering how come the current mediators are exposed as samples and
are not part of the Synapse core package? I would suggest that we bundle it
as org.apache.synapse.mediators and leave it to the discretion of the users
whether to use them or not.

Another feature that could be very useful is to have a clocking mechanism
for the mediators by which we can find out how much time each of the
mediators took to execute in milliseconds maybe. One use I can think of is
in Service level agreement (SLA).

Vikas and I did a bit of work and I guess we can put this clocking
module/code in the
org.apache.synapse.processors.mediatortypes.axis2.ServiceMediatorProcessor
class in case mediators implemented as axis2 services. So whenever a
mediator is executed we clock it and put it in the messageContext, which the
logging and monitoring mediator can use, in case of a breach of contract
(SLA) we can send email or take any action.

Your thoughts?

Best regards
Soumadeep




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


RE: Mediators exposed as samples!

Posted by Soumadeep <so...@infravio.com>.
Thanks Samida, would appreciate if you could tell me when, so that we can
start checking in stuff to the new directory.

Soumadeep
  -----Original Message-----
  From: Saminda Abeyruwan [mailto:samindaa@gmail.com]
  Sent: Monday, February 13, 2006 5:27 PM
  To: synapse-dev@ws.apache.org
  Subject: Re: Mediators exposed as samples!




  On 2/13/06, Soumadeep <so...@infravio.com> wrote:
    I agree, that's very correct but the current structure does not reflect
it :-). So any chance of migrating the deprecation mediator to it's rightful
place in the near future.

  Definelty.  :)

  Saminda



    Soumadeep
      -----Original Message-----
      From: Saminda Abeyruwan [mailto:samindaa@gmail.com]
      Sent: Monday, February 13, 2006 4:47 PM
      To: synapse-dev@ws.apache.org
      Subject: Re: Mediators exposed as samples!





        I was wondering how come the current mediators are exposed as
samples and
        are not part of the Synapse core package? I would suggest that we
bundle it
        as org.apache.synapse.mediators and leave it to the discretion of
the users
        whether to use them or not.

      IMHO core should only contain what is necessary for building up
Synapse (spi level). This can include build in mediators as well. But all
other mediators (api level) should come as separate of core because there
can be infinite number of them.

      This is way Paul has suggested the following project structure.

      - src {all core classes and build in mediators}
      - samples
                  +- src
      - mediators
                  +- src
      - extension
                   +- src
      - {other stuff, maven.xml,...}
      So Synapse can have synapse-core-XX.jar, synapse-samples-XX.jar,
synapse-mediators-XX.jar and synapse-extension-XX.jar(hopefully). Thus, need
to modify the maven.xml and project.xml.



        Another feature that could be very useful is to have a clocking
mechanism
        for the mediators by which we can find out how much time each of the
        mediators took to execute in milliseconds maybe. One use I can think
of is
        in Service level agreement (SLA).

        Vikas and I did a bit of work and I guess we can put this clocking
        module/code in the
        org.apache.synapse.processors.mediatortypes.axis2.ServiceMediatorPro
cessor
        class in case mediators implemented as axis2 services. So whenever a
        mediator is executed we clock it and put it in the messageContext,
which the
        logging and monitoring mediator can use, in case of a breach of
contract
        (SLA) we can send email or take any action.

      Isn't this a mediator implementation should care about. When Synapse
engine calling time for <servicemediator/> is pretty much a constant.
{Synapse-->Axis2}. So the mediator logic itself know how much time it need.
As SynaseMessage is exposed to Mediator impl one can set any property and
latter used in it's execution path or SynapseEnvironment for all the
incoming messages.

      Saminda








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






Re: Mediators exposed as samples!

Posted by Saminda Abeyruwan <sa...@gmail.com>.
On 2/13/06, Soumadeep <so...@infravio.com> wrote:
>
> I agree, that's very correct but the current structure does not reflect it
> :-). So any chance of migrating the deprecation mediator to it's rightful
> place in the near future.
>

Definelty.  :)

Saminda

Soumadeep
>
> -----Original Message-----
> *From:* Saminda Abeyruwan [mailto:samindaa@gmail.com]
> *Sent:* Monday, February 13, 2006 4:47 PM
> *To:* synapse-dev@ws.apache.org
> *Subject:* Re: Mediators exposed as samples!
>
>
>
>  I was wondering how come the current mediators are exposed as samples and
> >
> > are not part of the Synapse core package? I would suggest that we bundle
> > it
> > as org.apache.synapse.mediators and leave it to the discretion of the
> > users
> > whether to use them or not.
>
>
> IMHO core should only contain what is necessary for building up Synapse
> (spi level). This can include build in mediators as well. But all other
> mediators (api level) should come as separate of core because there can be
> infinite number of them.
>
> This is way Paul has suggested the following project structure.
>
> - src {all core classes and build in mediators}
> - samples
>             +- src
> - mediators
>             +- src
> - extension
>              +- src
> - {other stuff, maven.xml,...}
> So Synapse can have synapse-core-XX.jar, synapse-samples-XX.jar,
> synapse-mediators-XX.jar and synapse-extension-XX.jar(hopefully). Thus,
> need to modify the maven.xml and project.xml.
>
> Another feature that could be very useful is to have a clocking mechanism
> > for the mediators by which we can find out how much time each of the
> > mediators took to execute in milliseconds maybe. One use I can think of
> > is
> > in Service level agreement (SLA).
> >
> > Vikas and I did a bit of work and I guess we can put this clocking
> > module/code in the
> >
> > org.apache.synapse.processors.mediatortypes.axis2.ServiceMediatorProcessor
> > class in case mediators implemented as axis2 services. So whenever a
> > mediator is executed we clock it and put it in the messageContext, which
> > the
> > logging and monitoring mediator can use, in case of a breach of contract
> >
> > (SLA) we can send email or take any action.
>
>
> Isn't this a mediator implementation should care about. When Synapse
> engine calling time for <servicemediator/> is pretty much a constant.
> {Synapse-->Axis2}. So the mediator logic itself know how much time it need.
> As SynaseMessage is exposed to Mediator impl one can set any property and
> latter used in it's execution path or SynapseEnvironment for all the
> incoming messages.
>
> Saminda
>
>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>

Re: Mediators exposed as samples!

Posted by Saminda Abeyruwan <sa...@gmail.com>.
The prior project structure may be a post-M2 issue.

The prior mentioned anatomy will require a quite a lot of work in re-writing
maven.xml's and project.xml's. It's quite a challenge and I'm willing to
volunteer for this task, if it's considered to be a candidate for M2 release
:-).

Saminda


On 2/14/06, Soumadeep <so...@infravio.com> wrote:
>
> That's a good suggestion, have you done an impact analysis for this?
>
> Soumadeep
>
> -----Original Message-----
> From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
> Sent: Monday, February 13, 2006 10:20 PM
> To: synapse-dev@ws.apache.org
> Subject: Re: Mediators exposed as samples!
>
>
>
> >
> >This is way Paul has suggested the following project structure.
> >
> >- src {all core classes and build in mediators}
> >- samples
> >            +- src
> >- mediators
> >            +- src
> >- extension
> >             +- src
> >- {other stuff, maven.xml,...}
> >
> >
> >
> Are you gonna have multiple source folder and have another source folder
> on top. I think its the best time to go for multiproject strucuture.
> I know Synapse is a small project, compared to Axis2, but having more
> than one src folder in a single module project is highly discouraged, at
> least in maven world.
> If you are using maven, you can not specify more than one src folder. So
> you will have to hack maven to include the other src folders.
> So I suggest Synapse devs to move in to maven multiproject.
>
> my 2 cents..
>
> -- Chinthaka
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>

Re: Mediators exposed as samples!

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi,

As mentioned prior, i have changed the project structure to be multi-modules
and committed it to the scratch area under "synapse-multimodules".

Following goals exists for the project.

1. maven clean - {clean all the targets in modules}
2. maven jar - {compiles src and run test cases}
3. maven dist-bin - {generate binary distribution}
4. maven dist-src - {generate src distribution}
5. maven javadocs - {generate java documentation}
6. maven dist-mediators - {generate mediator distribution}
7. maven dist-extensions - {generate extensions distribution}

All the distributions will be available in root level target/dist directory.

All sample mediators will be available under modules/mediators directory
under the package org.apache.synapse.mediators.*.

Extensions are available at mediators/extensions. Currently spring based
mediator is present.

Everyone please be kind enough to run the samples, mediators, goal etc. and
report the list if need any modification.

Thank you

Saminda




On 2/14/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
>
>
> Saminda Abeyruwan wrote:
>
>
> So instead of the above structure, can we look for a multimodule project
> structure as follows,
>
> +-modules
>                 +-core
>                           +-src {xml processing and build in mediators -
> spi}
>                           +-test
>                           +-test-resources
>                 +-mediators
>                           +-src { api}
>                           +-test
>                           +-test-resources
>                 +-samples
>                           +-src
>                           +-scripts
>                 +-extensions
>                           +-src
>                 +-tools
>                           +-src {if needed}
> +-xdocs
> +-bin
> +-{maven.xml...stuff}
>
>  +1.
>
> -- Chinthaka
>
>
>

Re: Mediators exposed as samples!

Posted by Eran Chinthaka <ch...@opensource.lk>.

Saminda Abeyruwan wrote:

>
>
>
>So instead of the above structure, can we look for a multimodule project
>structure as follows,
>
>+-modules
>                +-core
>                          +-src {xml processing and build in mediators -
>spi}
>                          +-test
>                          +-test-resources
>                +-mediators
>                          +-src { api}
>                          +-test
>                          +-test-resources
>                +-samples
>                          +-src
>                          +-scripts
>                +-extensions
>                          +-src
>                +-tools
>                          +-src {if needed}
>+-xdocs
>+-bin
>+-{maven.xml...stuff}
>  
>
+1.

-- Chinthaka

>  
>

RE: Mediators exposed as samples!

Posted by Rajesh Koilpillai <ra...@infravio.com>.
+1 for Saminda's idea

 

Instead of having src at the root node for the 'core' module core/src seems
to be a better idea.

 

Thanks,

- Rajesh Koilpillai

 

  _____  

From: Saminda Abeyruwan [mailto:samindaa@gmail.com] 
Sent: Tuesday, February 14, 2006 1:00 PM
To: synapse-dev@ws.apache.org; chinthaka@opensource.lk
Subject: Re: Mediators exposed as samples!

 

 

On 2/13/06, Eran Chinthaka <ch...@opensource.lk> wrote:


>
>This is way Paul has suggested the following project structure.
>
>- src {all core classes and build in mediators}
>- samples
>            +- src
>- mediators
>            +- src 
>- extension
>             +- src
>- {other stuff, maven.xml,...}
>
>
>
Are you gonna have multiple source folder and have another source folder
on top. I think its the best time to go for multiproject strucuture. 
I know Synapse is a small project, compared to Axis2, but having more
than one src folder in a single module project is highly discouraged, at
least in maven world.
If you are using maven, you can not specify more than one src folder. So 
you will have to hack maven to include the other src folders.
So I suggest Synapse devs to move in to maven multiproject.

my 2 cents..

-- Chinthaka


So instead of the above structure, can we look for a multimodule project
structure as follows,

+-modules
                +-core
                          +-src {xml processing and build in mediators -
spi}
                          +-test
                          +-test-resources
                +-mediators
                          +-src { api}
                          +-test
                          +-test-resources
                +-samples
                          +-src
                          +-scripts  
                +-extensions
                          +-src
                +-tools
                          +-src {if needed}
+-xdocs
+-bin
+-{maven.xml...stuff}

Above is the standard way of setting maven multimodules. With the above
project structure, we can easily separate and build, synapse-core-XX.jar,
synapse-mediators-XX.jar etc and distributions.  

Saminda


  

 

 


Re: Mediators exposed as samples!

Posted by Saminda Abeyruwan <sa...@gmail.com>.
On 2/13/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
>
> >
> >This is way Paul has suggested the following project structure.
> >
> >- src {all core classes and build in mediators}
> >- samples
> >            +- src
> >- mediators
> >            +- src
> >- extension
> >             +- src
> >- {other stuff, maven.xml,...}
> >
> >
> >
> Are you gonna have multiple source folder and have another source folder
> on top. I think its the best time to go for multiproject strucuture.
> I know Synapse is a small project, compared to Axis2, but having more
> than one src folder in a single module project is highly discouraged, at
> least in maven world.
> If you are using maven, you can not specify more than one src folder. So
> you will have to hack maven to include the other src folders.
> So I suggest Synapse devs to move in to maven multiproject.
>
> my 2 cents..
>
> -- Chinthaka


So instead of the above structure, can we look for a multimodule project
structure as follows,

+-modules
                +-core
                          +-src {xml processing and build in mediators -
spi}
                          +-test
                          +-test-resources
                +-mediators
                          +-src { api}
                          +-test
                          +-test-resources
                +-samples
                          +-src
                          +-scripts
                +-extensions
                          +-src
                +-tools
                          +-src {if needed}
+-xdocs
+-bin
+-{maven.xml...stuff}

Above is the standard way of setting maven multimodules. With the above
project structure, we can easily separate and build, synapse-core-XX.jar,
synapse-mediators-XX.jar etc and distributions.

Saminda

RE: Mediators exposed as samples!

Posted by Soumadeep <so...@infravio.com>.
That's a good suggestion, have you done an impact analysis for this?

Soumadeep 

-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
Sent: Monday, February 13, 2006 10:20 PM
To: synapse-dev@ws.apache.org
Subject: Re: Mediators exposed as samples!



>
>This is way Paul has suggested the following project structure.
>
>- src {all core classes and build in mediators}
>- samples
>            +- src
>- mediators
>            +- src
>- extension
>             +- src
>- {other stuff, maven.xml,...}
>  
>
>
Are you gonna have multiple source folder and have another source folder
on top. I think its the best time to go for multiproject strucuture.
I know Synapse is a small project, compared to Axis2, but having more
than one src folder in a single module project is highly discouraged, at
least in maven world.
If you are using maven, you can not specify more than one src folder. So
you will have to hack maven to include the other src folders.
So I suggest Synapse devs to move in to maven multiproject.

my 2 cents..

-- Chinthaka



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


Re: Mediators exposed as samples!

Posted by Eran Chinthaka <ch...@opensource.lk>.
>
>This is way Paul has suggested the following project structure.
>
>- src {all core classes and build in mediators}
>- samples
>            +- src
>- mediators
>            +- src
>- extension
>             +- src
>- {other stuff, maven.xml,...}
>  
>
>
Are you gonna have multiple source folder and have another source folder
on top. I think its the best time to go for multiproject strucuture.
I know Synapse is a small project, compared to Axis2, but having more
than one src folder in a single module project is highly discouraged, at
least in maven world.
If you are using maven, you can not specify more than one src folder. So
you will have to hack maven to include the other src folders.
So I suggest Synapse devs to move in to maven multiproject.

my 2 cents..

-- Chinthaka

RE: Mediators exposed as samples!

Posted by Soumadeep <so...@infravio.com>.
I agree, that's very correct but the current structure does not reflect it
:-). So any chance of migrating the deprecation mediator to it's rightful
place in the near future.

Soumadeep
  -----Original Message-----
  From: Saminda Abeyruwan [mailto:samindaa@gmail.com]
  Sent: Monday, February 13, 2006 4:47 PM
  To: synapse-dev@ws.apache.org
  Subject: Re: Mediators exposed as samples!





    I was wondering how come the current mediators are exposed as samples
and
    are not part of the Synapse core package? I would suggest that we bundle
it
    as org.apache.synapse.mediators and leave it to the discretion of the
users
    whether to use them or not.

  IMHO core should only contain what is necessary for building up Synapse
(spi level). This can include build in mediators as well. But all other
mediators (api level) should come as separate of core because there can be
infinite number of them.

  This is way Paul has suggested the following project structure.

  - src {all core classes and build in mediators}
  - samples
              +- src
  - mediators
              +- src
  - extension
               +- src
  - {other stuff, maven.xml,...}
  So Synapse can have synapse-core-XX.jar, synapse-samples-XX.jar,
synapse-mediators-XX.jar and synapse-extension-XX.jar(hopefully). Thus, need
to modify the maven.xml and project.xml.



    Another feature that could be very useful is to have a clocking
mechanism
    for the mediators by which we can find out how much time each of the
    mediators took to execute in milliseconds maybe. One use I can think of
is
    in Service level agreement (SLA).

    Vikas and I did a bit of work and I guess we can put this clocking
    module/code in the
    org.apache.synapse.processors.mediatortypes.axis2.ServiceMediatorProcess
or
    class in case mediators implemented as axis2 services. So whenever a
    mediator is executed we clock it and put it in the messageContext, which
the
    logging and monitoring mediator can use, in case of a breach of contract
    (SLA) we can send email or take any action.

  Isn't this a mediator implementation should care about. When Synapse
engine calling time for <servicemediator/> is pretty much a constant.
{Synapse-->Axis2}. So the mediator logic itself know how much time it need.
As SynaseMessage is exposed to Mediator impl one can set any property and
latter used in it's execution path or SynapseEnvironment for all the
incoming messages.

  Saminda








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




Re: Mediators exposed as samples!

Posted by Saminda Abeyruwan <sa...@gmail.com>.
I was wondering how come the current mediators are exposed as samples and
> are not part of the Synapse core package? I would suggest that we bundle
> it
> as org.apache.synapse.mediators and leave it to the discretion of the
> users
> whether to use them or not.


IMHO core should only contain what is necessary for building up Synapse (spi
level). This can include build in mediators as well. But all other mediators
(api level) should come as separate of core because there can be infinite
number of them.

This is way Paul has suggested the following project structure.

- src {all core classes and build in mediators}
- samples
            +- src
- mediators
            +- src
- extension
             +- src
- {other stuff, maven.xml,...}
So Synapse can have synapse-core-XX.jar, synapse-samples-XX.jar,
synapse-mediators-XX.jar and synapse-extension-XX.jar(hopefully). Thus, need
to modify the maven.xml and project.xml.

Another feature that could be very useful is to have a clocking mechanism
> for the mediators by which we can find out how much time each of the
> mediators took to execute in milliseconds maybe. One use I can think of is
> in Service level agreement (SLA).
>
> Vikas and I did a bit of work and I guess we can put this clocking
> module/code in the
> org.apache.synapse.processors.mediatortypes.axis2.ServiceMediatorProcessor
> class in case mediators implemented as axis2 services. So whenever a
> mediator is executed we clock it and put it in the messageContext, which
> the
> logging and monitoring mediator can use, in case of a breach of contract
> (SLA) we can send email or take any action.


Isn't this a mediator implementation should care about. When Synapse engine
calling time for <servicemediator/> is pretty much a constant.
{Synapse-->Axis2}. So the mediator logic itself know how much time it need.
As SynaseMessage is exposed to Mediator impl one can set any property and
latter used in it's execution path or SynapseEnvironment for all the
incoming messages.

Saminda


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