You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Paul Fremantle <pz...@gmail.com> on 2007/07/24 16:38:58 UTC

Implementing long-running things in Synapse

We previously discussed allowing mediators to get warning about when
they get initialized. I was hoping to misuse this to start up work
items in Synapse. I realize that was a bit of a hack, so I have a new
idea:

* Have a startup part of the config where you can define some classes
that get called at startup and shutdown of Synapse. Each class must
implement some kind of startup()/init() method and corresponding
shutdown.
* The call gets passed a SynapseEnvironment
* We add access to the underlying threadpool into the
SynapseEnvironment so that these classes can start threads or work
items.

This could make it easy to do things like poll filesystems and inject
new messages. Much simpler than implementing a full Axis2 transport.

Paul

-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Implementing long-running things in Synapse

Posted by Davanum Srinivas <da...@gmail.com>.
+1 from me.

-- dims

On 7/28/07, Paul Fremantle <pz...@gmail.com> wrote:
> Actually I've been looking at Quartz. I had been imagining the
> initializer approach to start up Quartz.
>
> But now I've looked at Quartz I realize its a pretty generic way of
> starting up and stopping almost any kind of scheduled or long-running
> job.
>
> That made me think maybe we should just build Quartz directly into
> Synapse as the way of running other stuff. Its a pretty small
> framework (400k).
>
> Paul
>
> On 7/24/07, Paul Fremantle <pz...@gmail.com> wrote:
> > Asankha
> >
> > My mail wasn't very clear. I'm not suggesting mediators. I'm
> > suggesting creating a new class of objects inside Synapse alongside
> > mediators.
> >
> > Just like you don't want long running mediators, I don't think a
> > Quartz transport is the right thing either. It just isn't a transport!
> >
> > Paul
> >
> > On 7/24/07, Asankha C. Perera <as...@wso2.com> wrote:
> > > Paul
> > >
> > > For some reason I get a feeling that mediators should not play around
> > > with threads... So let me propose something else instead.. we create a
> > > Quartz/Timer transport that can kick off a sequence at a specified interval?
> > >
> > > asankha
> > >
> > > Paul Fremantle wrote:
> > > > We previously discussed allowing mediators to get warning about when
> > > > they get initialized. I was hoping to misuse this to start up work
> > > > items in Synapse. I realize that was a bit of a hack, so I have a new
> > > > idea:
> > > >
> > > > * Have a startup part of the config where you can define some classes
> > > > that get called at startup and shutdown of Synapse. Each class must
> > > > implement some kind of startup()/init() method and corresponding
> > > > shutdown.
> > > > * The call gets passed a SynapseEnvironment
> > > > * We add access to the underlying threadpool into the
> > > > SynapseEnvironment so that these classes can start threads or work
> > > > items.
> > > >
> > > > This could make it easy to do things like poll filesystems and inject
> > > > new messages. Much simpler than implementing a full Axis2 transport.
> > > >
> > > > Paul
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and VP of Technical Sales, WSO2
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

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


Re: Implementing long-running things in Synapse

Posted by Paul Fremantle <pz...@gmail.com>.
Actually I've been looking at Quartz. I had been imagining the
initializer approach to start up Quartz.

But now I've looked at Quartz I realize its a pretty generic way of
starting up and stopping almost any kind of scheduled or long-running
job.

That made me think maybe we should just build Quartz directly into
Synapse as the way of running other stuff. Its a pretty small
framework (400k).

Paul

On 7/24/07, Paul Fremantle <pz...@gmail.com> wrote:
> Asankha
>
> My mail wasn't very clear. I'm not suggesting mediators. I'm
> suggesting creating a new class of objects inside Synapse alongside
> mediators.
>
> Just like you don't want long running mediators, I don't think a
> Quartz transport is the right thing either. It just isn't a transport!
>
> Paul
>
> On 7/24/07, Asankha C. Perera <as...@wso2.com> wrote:
> > Paul
> >
> > For some reason I get a feeling that mediators should not play around
> > with threads... So let me propose something else instead.. we create a
> > Quartz/Timer transport that can kick off a sequence at a specified interval?
> >
> > asankha
> >
> > Paul Fremantle wrote:
> > > We previously discussed allowing mediators to get warning about when
> > > they get initialized. I was hoping to misuse this to start up work
> > > items in Synapse. I realize that was a bit of a hack, so I have a new
> > > idea:
> > >
> > > * Have a startup part of the config where you can define some classes
> > > that get called at startup and shutdown of Synapse. Each class must
> > > implement some kind of startup()/init() method and corresponding
> > > shutdown.
> > > * The call gets passed a SynapseEnvironment
> > > * We add access to the underlying threadpool into the
> > > SynapseEnvironment so that these classes can start threads or work
> > > items.
> > >
> > > This could make it easy to do things like poll filesystems and inject
> > > new messages. Much simpler than implementing a full Axis2 transport.
> > >
> > > Paul
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Implementing long-running things in Synapse

Posted by Paul Fremantle <pz...@gmail.com>.
Asankha

My mail wasn't very clear. I'm not suggesting mediators. I'm
suggesting creating a new class of objects inside Synapse alongside
mediators.

Just like you don't want long running mediators, I don't think a
Quartz transport is the right thing either. It just isn't a transport!

Paul

On 7/24/07, Asankha C. Perera <as...@wso2.com> wrote:
> Paul
>
> For some reason I get a feeling that mediators should not play around
> with threads... So let me propose something else instead.. we create a
> Quartz/Timer transport that can kick off a sequence at a specified interval?
>
> asankha
>
> Paul Fremantle wrote:
> > We previously discussed allowing mediators to get warning about when
> > they get initialized. I was hoping to misuse this to start up work
> > items in Synapse. I realize that was a bit of a hack, so I have a new
> > idea:
> >
> > * Have a startup part of the config where you can define some classes
> > that get called at startup and shutdown of Synapse. Each class must
> > implement some kind of startup()/init() method and corresponding
> > shutdown.
> > * The call gets passed a SynapseEnvironment
> > * We add access to the underlying threadpool into the
> > SynapseEnvironment so that these classes can start threads or work
> > items.
> >
> > This could make it easy to do things like poll filesystems and inject
> > new messages. Much simpler than implementing a full Axis2 transport.
> >
> > Paul
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Implementing long-running things in Synapse

Posted by "Asankha C. Perera" <as...@wso2.com>.
Paul

For some reason I get a feeling that mediators should not play around 
with threads... So let me propose something else instead.. we create a 
Quartz/Timer transport that can kick off a sequence at a specified interval?

asankha

Paul Fremantle wrote:
> We previously discussed allowing mediators to get warning about when
> they get initialized. I was hoping to misuse this to start up work
> items in Synapse. I realize that was a bit of a hack, so I have a new
> idea:
>
> * Have a startup part of the config where you can define some classes
> that get called at startup and shutdown of Synapse. Each class must
> implement some kind of startup()/init() method and corresponding
> shutdown.
> * The call gets passed a SynapseEnvironment
> * We add access to the underlying threadpool into the
> SynapseEnvironment so that these classes can start threads or work
> items.
>
> This could make it easy to do things like poll filesystems and inject
> new messages. Much simpler than implementing a full Axis2 transport.
>
> Paul
>

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