You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2007/05/14 22:17:42 UTC

ServiceMix and OSGI

While at JavaOne, we 've discussed using OSGI inside ServiceMix.
There are two areas where it can be used:
  * the first one is to replace classworlds / xbean to configure the
container.
    Using OSGI will enable better classloader control and will allow updates
    of JNDI, container and additionnal services at runtime
  * the second area would be to use it for deployement too.  This would also
    give better control on the classloader (share libraries between SU for
example),
    better versionning.  But I'm not sure yet how this could be compatible
with
    ServiceMix yet.  I guess we can use the same mechanism we use in the
    Geronimo deployer: the components / SAs are deployed as OSGI bundles
    and we use an OSGI listener to dynamically add it to ServiceMix.

I guess the next step is to use OSGI to deploy an artifact to a cluster
of ServiceMix instances, but i've no idea yet how it can be handled.
I will try to look at the container side first and will send an update soon
(I guess i will create a new branch to experiment a bit).
Any thoughts or additionnal ideas ?

-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: ServiceMix and OSGI

Posted by Guillaume Nodet <gn...@gmail.com>.
On 5/14/07, Bruce Snyder <br...@gmail.com> wrote:
>
> On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
> > While at JavaOne, we 've discussed using OSGI inside ServiceMix.
> > There are two areas where it can be used:
> >   * the first one is to replace classworlds / xbean to configure the
> > container.
>
> Please elaborate on the replacement of XBean. I'm fine with replacing
> ClassWorlds classloader architecture with OSGi because of OSGi's
> superior model. But I don't want to lose the XBean XML dialect in the
> config files.


I'm thinking of developing several OSGI modules for the core.
For example,  bundles for:
  * jmx / rmi
  * log config
  * transaction manager
  * jndi registry
  * ActiveMQ
  * Derby + data source
  * JBI container

So the whole configuration would not rely on XBean but on OSGI, each bundle
declaring a few properties to be externalized (like already done in the
servicemix.properties).
Some modules could internaly use spring/xbean/osgi for the wiring instead of
a java config.
Thus some modules would contain a spring config file.
However, event listeners would be deployed as separate bundles imho.
I'm still not sure how to handle flows / permissions yet.   I think the goal
is to
allow reconfiguring everything at runtime with the less disruption as
possible.

>     Using OSGI will enable better classloader control and will allow
> updates
> >     of JNDI, container and additionnal services at runtime
> >   * the second area would be to use it for deployement too.  This would
> also
> >     give better control on the classloader (share libraries between SU
> for
> > example),
> >     better versionning.  But I'm not sure yet how this could be
> compatible
> > with
> >     ServiceMix yet.  I guess we can use the same mechanism we use in the
> >     Geronimo deployer: the components / SAs are deployed as OSGI bundles
> >     and we use an OSGI listener to dynamically add it to ServiceMix.
> >
> > I guess the next step is to use OSGI to deploy an artifact to a cluster
> > of ServiceMix instances, but i've no idea yet how it can be handled.
> > I will try to look at the container side first and will send an update
> soon
> > (I guess i will create a new branch to experiment a bit).
> > Any thoughts or additionnal ideas ?
>
> So we're still thinking about ServiceMix running on top of an OSGi
> container, not embedding an OSGi container, correct?


Yes.

How will the use of OSGi affect the upgrade of various bundles at
> runtime? I.e., will we be able to upgrade the servicemix-core bundle
> on-the-fly?


OSGI enables that as far as I understand.
But I think it would require using OSGI bundles for components / SAs
and I'm still not sure how it would work.  I need to find more informations
on how an OSGI container handle updating a bundle with services, or a
bundle without services.


Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
>



-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: ServiceMix and OSGI

Posted by James Strachan <ja...@gmail.com>.
On 5/14/07, Bruce Snyder <br...@gmail.com> wrote:
> On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
> > While at JavaOne, we 've discussed using OSGI inside ServiceMix.
> > There are two areas where it can be used:
> >   * the first one is to replace classworlds / xbean to configure the
> > container.
>
> Please elaborate on the replacement of XBean. I'm fine with replacing
> ClassWorlds classloader architecture with OSGi because of OSGi's
> superior model. But I don't want to lose the XBean XML dialect in the
> config files.

I think Guillaume was mostly referring to the use of the xbean
server/kernel stuff for classloading. The use of xbean-spring for XML
configuration could be used in OSGi too.

e.g. components could use spring-osgi and xbean-spring and OSGi for
configuration & classloader handling.

-- 
James
-------
http://macstrac.blogspot.com/

Re: ServiceMix and OSGI

Posted by Bruce Snyder <br...@gmail.com>.
On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
> While at JavaOne, we 've discussed using OSGI inside ServiceMix.
> There are two areas where it can be used:
>   * the first one is to replace classworlds / xbean to configure the
> container.

Please elaborate on the replacement of XBean. I'm fine with replacing
ClassWorlds classloader architecture with OSGi because of OSGi's
superior model. But I don't want to lose the XBean XML dialect in the
config files.

>     Using OSGI will enable better classloader control and will allow updates
>     of JNDI, container and additionnal services at runtime
>   * the second area would be to use it for deployement too.  This would also
>     give better control on the classloader (share libraries between SU for
> example),
>     better versionning.  But I'm not sure yet how this could be compatible
> with
>     ServiceMix yet.  I guess we can use the same mechanism we use in the
>     Geronimo deployer: the components / SAs are deployed as OSGI bundles
>     and we use an OSGI listener to dynamically add it to ServiceMix.
>
> I guess the next step is to use OSGI to deploy an artifact to a cluster
> of ServiceMix instances, but i've no idea yet how it can be handled.
> I will try to look at the container side first and will send an update soon
> (I guess i will create a new branch to experiment a bit).
> Any thoughts or additionnal ideas ?

So we're still thinking about ServiceMix running on top of an OSGi
container, not embedding an OSGi container, correct?

How will the use of OSGi affect the upgrade of various bundles at
runtime? I.e., will we be able to upgrade the servicemix-core bundle
on-the-fly?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: ServiceMix and OSGI

Posted by James Strachan <ja...@gmail.com>.
On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
> While at JavaOne, we 've discussed using OSGI inside ServiceMix.

FWIW this was inspired also from the JBI EG meeting.


> There are two areas where it can be used:
>   * the first one is to replace classworlds / xbean to configure the
> container.
>     Using OSGI will enable better classloader control and will allow updates
>     of JNDI, container and additionnal services at runtime
>   * the second area would be to use it for deployement too.  This would also
>     give better control on the classloader (share libraries between SU for
> example),
>     better versionning.  But I'm not sure yet how this could be compatible
> with
>     ServiceMix yet.  I guess we can use the same mechanism we use in the
>     Geronimo deployer: the components / SAs are deployed as OSGI bundles
>     and we use an OSGI listener to dynamically add it to ServiceMix.

Sounds good to me.

Also ServiceMix could itself be an OSGi bundle that can then be
deployed in any OSGi container.


> I guess the next step is to use OSGI to deploy an artifact to a cluster
> of ServiceMix instances, but i've no idea yet how it can be handled.
> I will try to look at the container side first and will send an update soon
> (I guess i will create a new branch to experiment a bit).
> Any thoughts or additionnal ideas ?

Sounds good to me so far :) Go Guillaume!

Its also probably worth using the Felix maven plugin to turn most of
our jars we have into OSGi bundles too.
-- 
James
-------
http://macstrac.blogspot.com/

Re: ServiceMix and OSGI

Posted by Guillaume Nodet <gn...@gmail.com>.
I guess i will trash most of these plugins because they already have
better implementations inside felix.  But this is a good experiment anyway.
I'm currently having problems with the JNDI registry because it requires
the jars to be in the client classpath and I haven't find a way yet to do
that.

On 5/15/07, Guillaume Nodet <gn...@gmail.com> wrote:
>
> FYI, I've just checked in  the stuff I 'm working on at
>    http://svn.apache.org/repos/asf/incubator/servicemix/branches/osgi/
>
> If you build the project, you should be able to run the server in
>    ./dist/target
> by launching
>    java -jar bin/servicemix.jar
> or
>    ./servicemix
>
> There is really not much here, just enough to take a look at OSGI.
>
> On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
> >
> > While at JavaOne, we 've discussed using OSGI inside ServiceMix.
> > There are two areas where it can be used:
> >   * the first one is to replace classworlds / xbean to configure the
> > container.
> >     Using OSGI will enable better classloader control and will allow
> > updates
> >     of JNDI, container and additionnal services at runtime
> >   * the second area would be to use it for deployement too.  This would
> > also
> >     give better control on the classloader (share libraries between SU
> > for example),
> >     better versionning.  But I'm not sure yet how this could be
> > compatible with
> >     ServiceMix yet.  I guess we can use the same mechanism we use in the
> >     Geronimo deployer: the components / SAs are deployed as OSGI bundles
> >
> >     and we use an OSGI listener to dynamically add it to ServiceMix.
> >
> > I guess the next step is to use OSGI to deploy an artifact to a cluster
> > of ServiceMix instances, but i've no idea yet how it can be handled.
> > I will try to look at the container side first and will send an update
> > soon
> > (I guess i will create a new branch to experiment a bit).
> > Any thoughts or additionnal ideas ?
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/
>



-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: ServiceMix and OSGI

Posted by Guillaume Nodet <gn...@gmail.com>.
FYI, I've just checked in  the stuff I 'm working on at
   http://svn.apache.org/repos/asf/incubator/servicemix/branches/osgi/

If you build the project, you should be able to run the server in
   ./dist/target
by launching
   java -jar bin/servicemix.jar
or
   ./servicemix

There is really not much here, just enough to take a look at OSGI.

On 5/14/07, Guillaume Nodet <gn...@gmail.com> wrote:
>
> While at JavaOne, we 've discussed using OSGI inside ServiceMix.
> There are two areas where it can be used:
>   * the first one is to replace classworlds / xbean to configure the
> container.
>     Using OSGI will enable better classloader control and will allow
> updates
>     of JNDI, container and additionnal services at runtime
>   * the second area would be to use it for deployement too.  This would
> also
>     give better control on the classloader (share libraries between SU for
> example),
>     better versionning.  But I'm not sure yet how this could be compatible
> with
>     ServiceMix yet.  I guess we can use the same mechanism we use in the
>     Geronimo deployer: the components / SAs are deployed as OSGI bundles
>     and we use an OSGI listener to dynamically add it to ServiceMix.
>
> I guess the next step is to use OSGI to deploy an artifact to a cluster
> of ServiceMix instances, but i've no idea yet how it can be handled.
> I will try to look at the container side first and will send an update
> soon
> (I guess i will create a new branch to experiment a bit).
> Any thoughts or additionnal ideas ?
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/




-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/