synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Udayanga Wickramasinghe <mastershield2...@gmail.com>
Subject Re: Adding hot deployment/update support to synapse custom mediators
Date Fri, 12 Apr 2013 07:55:23 GMT
Hi Kasun,

On Thu, Apr 11, 2013 at 6:14 AM, Kasun Indrasiri <kasun147@gmail.com> wrote:

> Hi Udayanga/Amila,
>
> I have basically tried xar and synapse-lib approaches.
>
> *XAR - Entension Deployer *
> *
> *
> - The extension deployer seems to carter these requirements. For instance,
> we can create a custom mediator and create a .xar with the use of xar
> plugin.
> - I've tested with a simple custom mediator and
> deployed( /repository/extensions) that as an .xar. It works fine for hot
> deployment and hot update (only if we update the referring sequence)
> - However  the limitation here is that, once the xar is hot updated, what
> ever the sequence that are referring this particular customer mediator has
> to be redeployed to take the new modifications of mediator in to effect.
>
> *Synapse-Lib*
> *
> *
> - With this approach we can hot deploy/hot update a '*class*' mediator as
> long as the class mediators reside in the templates which are bundled with
> the sample synapse-lib archive. So, without redeploying the sequence that
> are calling (call-template) those templates.
> - However, the hot deployment nor hot update doesn't work for '*custom*'
> mediators(with factories and serializers) and its because the newly added
> custom mediator factory and serializers not loaded by the Library deployer.
> I think we could fix the Library deployer to support custom mediators as
> well (as we do with xar).
>

currently mediation library doesn't register factory and serializer
services on deployment.. I think this can be fixed fairly quickly as with
xar. Although both solutions seem to work i think synapse
library archives have more of a advantage with not having to
re-deploy referring sequences whenever an update takes place..

Thanks
Udayanga


>
> 2013-04-11 15:34:07,223 [-] [Timer-0] ERROR LibraryArtifactDeployer
> Deployment of the Synapse Artifact from file :
> /home/kasun/development/wso2/wso2svn/apache/synapse/new_trunk/modules/distribution/target/synapse-2.2.0-SNAPSHOT/repository/conf/synapse-libs/synapse-eipcore-lib.zip
> : Failed!
> org.apache.synapse.deployers.SynapseArtifactDeploymentException: Template
> configuration : null cannot be builtfor Synapse Library artifact :
> dynamic_router
> at
> org.apache.synapse.libraries.model.LibraryArtifact$TemplateArtifactFile.build(LibraryArtifact.java:183)
>  at
> org.apache.synapse.libraries.model.LibraryArtifact.loadComponentsInto(LibraryArtifact.java:100)
> ...
> Caused by: org.apache.synapse.SynapseException: Unknown mediator
> referenced by configuration element : {
> http://ws.apache.org/ns/synapse}surchargeStockQuote
>
>
> Any thoughts?
>
> Thanks,
>
>
>
> On Mon, Apr 8, 2013 at 3:03 AM, Udayanga Wickramasinghe <
> mastershield2007@gmail.com> wrote:
>
>> Hi Amila,
>> It works more or less similar to axis2 archive file (.aar) and
>> class-loading is very similar (ie:- loads classes from top level of the
>> archive or from .jar files located in /lib ).. However each time a
>> mediation library archive is deployed it will load (ie:- lazy loading) the
>> content in to memory, construct class-loading , etc . And only after users
>> explicitly import (ie:- through <import ..> synapse construct ) the library
>> package , would synapse load its artifacts and made available to its users
>> at runtime...
>> More information on this can be found
>> in docs/userguide/template_library.html . Also set of samples can be found
>> in samples catalog -- samples 850 - 857
>> If you want to test above samples EIP core library will be located in
>> "modules/core/target/library_repos/synapse-eipcore-lib.zip" and copy the
>> file into synapse distribution "repository/conf/synapse-libs" path..
>>
>> Regards,
>> Udayanga
>>
>>
>> On Sun, Apr 7, 2013 at 11:22 AM, Amila Suriarachchi <
>> amilasuriarachchi@gmail.com> wrote:
>>
>>>
>>>
>>>
>>> On Sun, Apr 7, 2013 at 3:36 AM, Udayanga Wickramasinghe <
>>> mastershield2007@gmail.com> wrote:
>>>
>>>> Hi Amila,
>>>> If you look up at the newly added synapse mediation library archive
>>>> (.zip) feature , has the same functionality you are looking for. You should
>>>> be able to hot update/deploy custom mediators (deploy custom mediators at
>>>> /lib of the archive) and/or almost any other synapse artifact , through
>>>> that.
>>>>
>>>
>>> Do you know how that works? How do we have to deploy the custom
>>> mediators and how synapse load classes?
>>>
>>> Basically if that provides hot update/deploy that is fine.
>>>
>>> thanks,
>>> Amila.
>>>
>>>>
>>>> Regards,
>>>> Udayanga
>>>>
>>>>
>>>> On Sun, Apr 7, 2013 at 6:01 AM, Amila Suriarachchi <
>>>> amilasuriarachchi@gmail.com> wrote:
>>>>
>>>>> hi,
>>>>>
>>>>> Currently Synapse custom mediators has to deploy as a jar and should
>>>>> be available at the server starts up time. But there are situations we
need
>>>>> to hot update/deploy these custom mediators.
>>>>>
>>>>> Can we have a method like in .aar files where we bundle synapse
>>>>> mediators as an archive file possibly with a descriptor file and make
it
>>>>> hot update deploy?
>>>>>
>>>>> thanks,
>>>>> Amila.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Amila Suriarachchi
>>>>> WSO2 Inc.
>>>>> blog: http://amilachinthaka.blogspot.com/
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://www.udayangawiki.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Amila Suriarachchi
>>> WSO2 Inc.
>>> blog: http://amilachinthaka.blogspot.com/
>>>
>>
>>
>>
>> --
>> http://www.udayangawiki.blogspot.com
>>
>
>
>
> --
> Kasun Indrasiri
> Associate Technical Lead,
> WSO2 Inc. - "Lean . Enterprise . Middleware" - http://www.wso2.com/
> Blog : http://kasunpanorama.blogspot.com/
>



-- 
http://www.udayangawiki.blogspot.com

Mime
View raw message