You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Fredrik Hultin <fr...@hotmail.com> on 2002/05/14 13:43:13 UTC

Avalon and Messaging

Hi, 
I have a couple of questions about messaging and the component model:
 
I am designing an application server that must be both fast and possible
to distribute. For the application part I will use something like
Phoenix or the Excalibur component manager (or maybe fortress). The big
problem is the distributional part. 
 
An application server can contain a number of services just like in the
Avalon model. The difference is that I want to add an asynchronous
communication model like JMS to the application server. Services can be
spread out on different nodes running a version of the application
server. However, when sending messages, the services should be unaware
that messages are being sent over the internet to another application
server. 
 
One way as I see it is to make a wrapper component to a standard JMS
server as a façade object for the services in the application server.
The big question is if JMS servers perform well locally. It feels like a
big overhead to use a JMS server to send messages between services that
executes in the same virtual machine.
 
Another solution is to implement the JMS server as an Avalon service. By
doing that I can let the JMS server be more intelligent and only send
messages between machines or JVM’s and make something simpler for the
local case.
 
Any thoughts or suggestions?
Is there anyone else doing the same thing out there?
 
Any plans to build a JMS server as an Avalon service?
 
Regards
Fredrik Hultin

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Avalon and Messaging

Posted by Tim Anderson <ti...@intalio.com>.
> From: Peter Donald [mailto:peter@apache.org]
> Sent: Wednesday, May 15, 2002 9:11 PM
>
> On Wed, 15 May 2002 10:00, Tim Anderson wrote:
> > Support for local dispatching of messages in OpenJMS
> > is on my TODO list.
>
> That would be neat.
>
> WIll there also be a non-serializing version because that would
> be good ;) You
> could either set a flag to say that it is valid to pass by reference (and
> thus that you weren't going to change the message on sender side)
> or detect
> if messagee is made up of only primitive or immutable types.
>

That will be the only behaviour supported. To be compliant with
the JMS spec, messages have to be copied. We currently clone
entire messages, although this will eventually be changed
to use a copy-on-write approach.

-Tim


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Peter Donald <pe...@apache.org>.
On Wed, 15 May 2002 10:00, Tim Anderson wrote:
> Support for local dispatching of messages in OpenJMS
> is on my TODO list. 

That would be neat.

WIll there also be a non-serializing version because that would be good ;) You 
could either set a flag to say that it is valid to pass by reference (and 
thus that you weren't going to change the message on sender side) or detect 
if messagee is made up of only primitive or immutable types.

-- 
Cheers,

Peter Donald


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Avalon and Messaging

Posted by Tim Anderson <ti...@intalio.com>.
Support for local dispatching of messages in OpenJMS
is on my TODO list. We do provide a connector for this
at the moment, but its not particularly useful. 

The ultimate goal is to automatically dispatch messages locally
if the client and server reside in the same JVM, falling back
to tcp or http when they are in different JVMs.

Regards

Tim


> -----Original Message-----
> From: Alexis Agahi [mailto:alag@users.sourceforge.net]
> Sent: Wednesday, May 15, 2002 5:04 AM
> To: Avalon Developers List
> Subject: Re: Avalon and Messaging
> 
> 
> Fredrik Hultin wrote:
> 
> 
> > That is great! Do you know how the JMS server will work in the local
> > case, e.g. when two local services call each other through JMS? Would
> > that only be dispatched locally or treated as any normal JMS message?
> 
> Well... not easy. If I assume that I bypass the JMS API and 
> perform such optimization, this could be unportable for other JMS 
> implementation...
> 
> In fact, for my project the message persistance (storage in 
> database if the subscriber is not reachable) was key feature so I 
>   did not focus on that aspect...
> 
> --
> Al
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Alexis Agahi <al...@users.sourceforge.net>.
Fredrik Hultin wrote:


> That is great! Do you know how the JMS server will work in the local
> case, e.g. when two local services call each other through JMS? Would
> that only be dispatched locally or treated as any normal JMS message?

Well... not easy. If I assume that I bypass the JMS API and 
perform such optimization, this could be unportable for other JMS 
implementation...

In fact, for my project the message persistance (storage in 
database if the subscriber is not reachable) was key feature so I 
  did not focus on that aspect...

--
Al


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Avalon and Messaging

Posted by David BERNARD <dw...@freesurf.fr>.
Hi!
 
> > I've planned to release something next week (or in 15 days if I'm
> > overloaded).

Good !

If you don't know take a look at JORAM (an other JMS implementation),
you could also find a JMS Test Suite (LGPL) :

http://www.objectweb.org/joram/
 
> That is great! Do you know how the JMS server will work in the local
> case, e.g. when two local services call each other through JMS? Would
> that only be dispatched locally or treated as any normal JMS message?

Look at http://sourceforge.net/projects/somnifugi/
"Somnifugi is an implementation of JMS that works exclusively inside a
single JVM to transfer messages between threads. Somnifugi lets you
create very loosely coupled subsystems that communicate using the JMS
APIs without the overhead of sockets." (BSD License)


Regards.
-- 
--------------------------------------------------------------
David "Dwayne" Bernard             Freelance Developer (Java)
                                   mailto:dwayne@java-fan.com
      \|/                          http://dwayne.java-fan.com
--o0O @.@ O0o-------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Avalon and Messaging

Posted by Fredrik Hultin <fr...@hotmail.com>.
Hi!

> I've planned to release something next week (or in 15 days if I'm
> overloaded).

That is great! Do you know how the JMS server will work in the local
case, e.g. when two local services call each other through JMS? Would
that only be dispatched locally or treated as any normal JMS message?

Regards
Fredrik


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Alexis Agahi <al...@users.sourceforge.net>.
Fredrik Hultin wrote:

> Any plans to build a JMS server as an Avalon service?

With the help of OpenJMS developper, I'm working on a port of 
OpenJMS as Phoenix componant.

I've planned to release something next week (or in 15 days if I'm 
overloaded).

I'll submit the code to be added in apps.

Regards

--
Al - http://javajabber.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Michael Nash <mi...@jglobalonline.com>.
Paul, Fredrik:

> >Is there anyone else doing the same thing out there?

Yes, there is :-)

> >Any plans to build a JMS server as an Avalon service?
> >  
> >
> Well there is Enterprise Object Broker but it has no JMS capability. I 
> have several times heard rumours of people wanting to wrap OpenJMS as a 
> Phoenix service/block, but I have not yet seen work published on that.

I'm experimenting with exactly that - I want to use messaging as the mechanism for the 'front-end' - likely Cocoon - to talk to the 'back-end' - Phoenix, where both are potentially distributed (but not necessarily - I'd like to be able to do either). I'd be happy to discuss ideas and what discoveries have been made so far. Feel free to contact me off-list if this isn't on-topic here.

Mike Nash
JGlobal Ltd.
http://www.jglobalonline.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Paul Hammant <Pa...@yahoo.com>.
Fredrik,

>I am designing an application server that must be both fast and possible
>to distribute. For the application part I will use something like
>Phoenix or the Excalibur component manager (or maybe fortress). The big
>problem is the distributional part. 
> 
>
Kewl.  OpenSource?

>Any thoughts or suggestions?
>Is there anyone else doing the same thing out there?
>  
>
>Any plans to build a JMS server as an Avalon service?
>  
>
Well there is Enterprise Object Broker but it has no JMS capability. I 
have several times heard rumours of people wanting to wrap OpenJMS as a 
Phoenix service/block, but I have not yet seen work published on that.

Regards,

- Paul


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Peter Donald <pe...@apache.org>.
On Thu, 16 May 2002 00:21, Michael Nash wrote:
> > >Lets assume that calls to this service can be done asynchronously (sp?),
> > > ie you make the call but you don't need to wait for a return value.
>
> Wouldn't this same approach work even in a synchronous environment? If
> we're talking about invoking some kind of business logic a response is
> likely required - maybe a seperate message back in the other direction...

Its definetly doable. Just a little bit more complex to write the 
InvocationHandler depending on what transport you choose to use.

> > >InvocationHandler myInvocationHandler =
> > >       new MyInvocationHandler( "myQueueName" );
> > >myService = (MyService)Proxy.newProxyInstance(
> > >                                   new Class[] { MyService.class },
> > >                                   myInvocationHandler );
>
> Yes, I see how this would work - and be transparent to the caller! Very
> nice. The invoke method of the InvokationHandler interface can return an
> Object, though - if necessary this could be the response, could it not?
> (E.g. for invokations that are synchronous, the invokation handler would
> send the message, wait for the response, then return it to the caller as
> the return Object. Where it's not necessary, it can just hand back null)

yep.

> Anyone see a problem with this approach? Otherwise I'll start
> experimenting!

I use it all the time and find it great. Theres a few gotchas (specifically 
you should make sure that the parent ClassLoader of proxy code is always the 
same or else you can be regenerating the proxies classes multiple times).

-- 
Cheers,

Peter Donald


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Michael Nash <mi...@jglobalonline.com>.
Stephen, Pete:

> >I have a suggestion, depending on how fine grained your services are and 
> >whether they are sync or async. For each service you define an interface. 

The services I was thinking about would be fairly coarse-grained, e.g. basically business logic, access to database persistance, that kind of thing.

> >Lets assume that calls to this service can be done asynchronously (sp?), ie 
> >you make the call but you don't need to wait for a return value. 

Wouldn't this same approach work even in a synchronous environment? If we're talking about invoking some kind of business logic a response is likely required - maybe a seperate message back in the other direction...

> You then 
> >write a component/block that implements the interface. Same as normal avalon 
> >component at this stage.
> >
> >Then you write a JDK1.3 InvocationHandler. This will transalte the method call 
> >into a ObjectMessage (or whatever) and transmit it using JMS. This could 
> >easily be done using reflection.
> >
> >Then you build a proxy that uses InvocationHandler (and talks using JMS) if 
> >you wanted to reference remote object. Something like
> >
> >InvocationHandler myInvocationHandler = 
> >       new MyInvocationHandler( "myQueueName" );
> >myService = (MyService)Proxy.newProxyInstance( 
> >                                   new Class[] { MyService.class }, 
> >                                   myInvocationHandler );
> >

Yes, I see how this would work - and be transparent to the caller! Very nice. The invoke method of the InvokationHandler interface can return an Object, though - if necessary this could be the response, could it not? (E.g. for invokations that are synchronous, the invokation handler would send the message, wait for the response, then return it to the caller as the return Object. Where it's not necessary, it can just hand back null)

> And if will drill one layer deeper, we could perhaps come up with some 
> interfaces and base/abstract classes enabling pluggable async transport 
> solutions (e.g. JMS or CORBA Messaging).

Absolutely. The transport would be unknown to the caller, and in fact could be just a straight method call when it's local. I wasn't familiar with the new Dynamic Proxy API in 1.3, thanks for the pointer! 

Anyone see a problem with this approach? Otherwise I'll start experimenting!

Thanks!,

Michael Nash
JGlobal Ltd.
http://www.jglobalonline.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Stephen McConnell <mc...@osm.net>.

Peter Donald wrote:

>Hi,
>
>I have a suggestion, depending on how fine grained your services are and 
>whether they are sync or async. For each service you define an interface. 
>
>Lets assume that calls to this service can be done asynchronously (sp?), ie 
>you make the call but you don't need to wait for a return value. You then 
>write a component/block that implements the interface. Same as normal avalon 
>component at this stage.
>
>Then you write a JDK1.3 InvocationHandler. This will transalte the method call 
>into a ObjectMessage (or whatever) and transmit it using JMS. This could 
>easily be done using reflection.
>
>Then you build a proxy that uses InvocationHandler (and talks using JMS) if 
>you wanted to reference remote object. Something like
>
>InvocationHandler myInvocationHandler = 
>       new MyInvocationHandler( "myQueueName" );
>myService = (MyService)Proxy.newProxyInstance( 
>                                   new Class[] { MyService.class }, 
>                                   myInvocationHandler );
>

And if will drill one layer deeper, we could perhaps come up with some 
interfaces and base/abstract classes enabling pluggable async transport 
solutions (e.g. JMS or CORBA Messaging).

Cheers, Steve.

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Avalon and Messaging

Posted by Peter Donald <pe...@apache.org>.
Hi,

I have a suggestion, depending on how fine grained your services are and 
whether they are sync or async. For each service you define an interface. 

Lets assume that calls to this service can be done asynchronously (sp?), ie 
you make the call but you don't need to wait for a return value. You then 
write a component/block that implements the interface. Same as normal avalon 
component at this stage.

Then you write a JDK1.3 InvocationHandler. This will transalte the method call 
into a ObjectMessage (or whatever) and transmit it using JMS. This could 
easily be done using reflection.

Then you build a proxy that uses InvocationHandler (and talks using JMS) if 
you wanted to reference remote object. Something like

InvocationHandler myInvocationHandler = 
       new MyInvocationHandler( "myQueueName" );
myService = (MyService)Proxy.newProxyInstance( 
                                   new Class[] { MyService.class }, 
                                   myInvocationHandler );

Then the users of myService can use it the same way regardless of whether it 
is local or remote object. The only difference occurs when you create the 
component.

None of the containers natively support remote components this way. I have got 
requests in past to enhance Phoenix to do this but as of yet have not got 
around to implementing it.

On Tue, 14 May 2002 21:43, Fredrik Hultin wrote:
> Hi,
> I have a couple of questions about messaging and the component model:
>
> I am designing an application server that must be both fast and possible
> to distribute. For the application part I will use something like
> Phoenix or the Excalibur component manager (or maybe fortress). The big
> problem is the distributional part.
>
> An application server can contain a number of services just like in the
> Avalon model. The difference is that I want to add an asynchronous
> communication model like JMS to the application server. Services can be
> spread out on different nodes running a version of the application
> server. However, when sending messages, the services should be unaware
> that messages are being sent over the internet to another application
> server.
>
> One way as I see it is to make a wrapper component to a standard JMS
> server as a façade object for the services in the application server.
> The big question is if JMS servers perform well locally. It feels like a
> big overhead to use a JMS server to send messages between services that
> executes in the same virtual machine.
>
> Another solution is to implement the JMS server as an Avalon service. By
> doing that I can let the JMS server be more intelligent and only send
> messages between machines or JVM’s and make something simpler for the
> local case.
>
> Any thoughts or suggestions?
> Is there anyone else doing the same thing out there?
>
> Any plans to build a JMS server as an Avalon service?
>
> Regards
> Fredrik Hultin

-- 
Cheers,

Peter Donald


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>