|
From: <jas...@ma...> - 2004-10-27 09:23:19
|
This has been an ongoing area of research for some time - how best to do JMS consumption from inside Spring. After scratching my head for a while over the best way to do this; I figured, JCA is the answer, since it takes care of all the thorny issues behind doing proper consumer based JMS pooling and transaction handling, which is way more complex than you might imagine. The only downside of this approach is that folks often think JCA is really complex & fat & depends on a J2EE container which is not true. As part of the ActiveMQ project we've written a small, Spring based & easily embedded JCA container. Its just a few classes and is easy to use on any project, just depending on Spring and the JCA APIs. http://activemq.codehaus.org/JCA+Container So we can now have all the features of MDB such as efficient JMS pooling, hooks to work with all the major JMS providers via their JCA Resource Adapters (*), proper transaction handling and pooling of message listeners - but all from within Spring. We get the added benefit that we get to use Spring's Dependency Injection to configure the message listeners properly - plus we can easily perform the dynamic creation of new subscriptions easily at runtime, rather than having to rely on a fixed & rigid XML deployment configuration like EJB. So now we've 'message driven pojos' in Spring! :) To give you an idea of how simple it is, here's a sample... http://cvs.activemq.codehaus.org/viewrep/activemq/activemq/modules/ container/src/test/org/codehaus/activemq/jca/spring.xml?r=HEAD There's more detailed documentation on the above page if you need it. (*) to help work with other JMS providers which don't yet provide a JCA ResourceAdapter, which they really should if they want to integrate well with other J2EE containers, we could enhance ActiveMQ's ResourceAdapter to work with foreign JMS providers. James ------- http://radio.weblogs.com/0112098/ |
|
From: Nick M. <nic...@gm...> - 2004-10-27 09:29:57
|
Cool! Will be looking at this very shortly... -Nick On Wed, 27 Oct 2004 10:23:07 +0100, jas...@ma... <jas...@ma...> wrote: > This has been an ongoing area of research for some time - how best to > do JMS consumption from inside Spring. After scratching my head for a > while over the best way to do this; I figured, JCA is the answer, since > it takes care of all the thorny issues behind doing proper consumer > based JMS pooling and transaction handling, which is way more complex > than you might imagine. The only downside of this approach is that > folks often think JCA is really complex & fat & depends on a J2EE > container which is not true. > > As part of the ActiveMQ project we've written a small, Spring based & > easily embedded JCA container. Its just a few classes and is easy to > use on any project, just depending on Spring and the JCA APIs. > > http://activemq.codehaus.org/JCA+Container > > So we can now have all the features of MDB such as efficient JMS > pooling, hooks to work with all the major JMS providers via their JCA > Resource Adapters (*), proper transaction handling and pooling of > message listeners - but all from within Spring. We get the added > benefit that we get to use Spring's Dependency Injection to configure > the message listeners properly - plus we can easily perform the dynamic > creation of new subscriptions easily at runtime, rather than having to > rely on a fixed & rigid XML deployment configuration like EJB. > > So now we've 'message driven pojos' in Spring! :) > > To give you an idea of how simple it is, here's a sample... > > http://cvs.activemq.codehaus.org/viewrep/activemq/activemq/modules/ > container/src/test/org/codehaus/activemq/jca/spring.xml?r=HEAD > > There's more detailed documentation on the above page if you need it. > > (*) to help work with other JMS providers which don't yet provide a JCA > ResourceAdapter, which they really should if they want to integrate > well with other J2EE containers, we could enhance ActiveMQ's > ResourceAdapter to work with foreign JMS providers. > > James > ------- > http://radio.weblogs.com/0112098/ > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Thomas R. <tho...@tr...> - 2004-10-27 10:27:30
|
James, Spring MDP (Message Driven Pojos) - very cool. The docs mention that you need j2ee.jar for the JCA stuff. Spring already ships with connector-api.jar. Would that be sufficient or do you need the full j2ee.jar? Thomas jas...@ma... wrote: > This has been an ongoing area of research for some time - how best to > do JMS consumption from inside Spring. After scratching my head for a > while over the best way to do this; I figured, JCA is the answer, > since it takes care of all the thorny issues behind doing proper > consumer based JMS pooling and transaction handling, which is way > more complex than you might imagine. The only downside of this > approach is that folks often think JCA is really complex & fat & > depends on a J2EE container which is not true. > > As part of the ActiveMQ project we've written a small, Spring based & > easily embedded JCA container. Its just a few classes and is easy to > use on any project, just depending on Spring and the JCA APIs. > > http://activemq.codehaus.org/JCA+Container > > So we can now have all the features of MDB such as efficient JMS > pooling, hooks to work with all the major JMS providers via their JCA > Resource Adapters (*), proper transaction handling and pooling of > message listeners - but all from within Spring. We get the added > benefit that we get to use Spring's Dependency Injection to configure > the message listeners properly - plus we can easily perform the > dynamic creation of new subscriptions easily at runtime, rather than > having to rely on a fixed & rigid XML deployment configuration like EJB. > > So now we've 'message driven pojos' in Spring! :) > > To give you an idea of how simple it is, here's a sample... > > http://cvs.activemq.codehaus.org/viewrep/activemq/activemq/modules/ > container/src/test/org/codehaus/activemq/jca/spring.xml?r=HEAD > > There's more detailed documentation on the above page if you need it. > > > (*) to help work with other JMS providers which don't yet provide a > JCA ResourceAdapter, which they really should if they want to > integrate well with other J2EE containers, we could enhance > ActiveMQ's ResourceAdapter to work with foreign JMS providers. > > James > ------- > http://radio.weblogs.com/0112098/ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > |
|
From: <jas...@ma...> - 2004-10-27 10:31:36
|
On 27 Oct 2004, at 11:27, Thomas Risberg wrote: > James, > > Spring MDP (Message Driven Pojos) - very cool. > The docs mention that you need j2ee.jar for the JCA stuff. Spring > already ships with connector-api.jar. Would that be sufficient or do > you need the full j2ee.jar? Thats all you need yes. Just the APIs for javax.resource.spi.* for the JCA ResourceAdapter and WorkManager stuff. James ------- http://radio.weblogs.com/0112098/ |
|
From: <jas...@ma...> - 2004-10-27 15:24:19
|
On 27 Oct 2004, at 11:31, jas...@ma... wrote: > On 27 Oct 2004, at 11:27, Thomas Risberg wrote: >> James, >> >> Spring MDP (Message Driven Pojos) - very cool. >> The docs mention that you need j2ee.jar for the JCA stuff. Spring >> already ships with connector-api.jar. Would that be sufficient or do >> you need the full j2ee.jar? > > Thats all you need yes. Just the APIs for javax.resource.spi.* for the > JCA ResourceAdapter and WorkManager stuff. To be precise, its JCA 1.5 thats required (i.e. the J2EE 1.4 stuff). James ------- http://radio.weblogs.com/0112098/ |
|
From: Colin S. <col...@ex...> - 2004-10-27 13:18:33
|
very nice! jas...@ma... wrote: > This has been an ongoing area of research for some time - how best to > do JMS consumption from inside Spring. After scratching my head for a > while over the best way to do this; I figured, JCA is the answer, > since it takes care of all the thorny issues behind doing proper > consumer based JMS pooling and transaction handling, which is way > more complex than you might imagine. The only downside of this > approach is that folks often think JCA is really complex & fat & > depends on a J2EE container which is not true. > > As part of the ActiveMQ project we've written a small, Spring based & > easily embedded JCA container. Its just a few classes and is easy to > use on any project, just depending on Spring and the JCA APIs. > > http://activemq.codehaus.org/JCA+Container > > So we can now have all the features of MDB such as efficient JMS > pooling, hooks to work with all the major JMS providers via their JCA > Resource Adapters (*), proper transaction handling and pooling of > message listeners - but all from within Spring. We get the added > benefit that we get to use Spring's Dependency Injection to configure > the message listeners properly - plus we can easily perform the > dynamic creation of new subscriptions easily at runtime, rather than > having to rely on a fixed & rigid XML deployment configuration like EJB. > > So now we've 'message driven pojos' in Spring! :) > > To give you an idea of how simple it is, here's a sample... > > http://cvs.activemq.codehaus.org/viewrep/activemq/activemq/modules/ > container/src/test/org/codehaus/activemq/jca/spring.xml?r=HEAD > > There's more detailed documentation on the above page if you need it. > > > (*) to help work with other JMS providers which don't yet provide a > JCA ResourceAdapter, which they really should if they want to > integrate well with other J2EE containers, we could enhance > ActiveMQ's ResourceAdapter to work with foreign JMS providers. > > James > ------- > http://radio.weblogs.com/0112098/ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Oliver G. <o.g...@ce...> - 2004-10-28 08:31:27
|
Hi jas...@ma... wrote: [...] > As part of the ActiveMQ project we've written a small, Spring based & > easily embedded JCA container. Its just a few classes and is easy to > use on any project, just depending on Spring and the JCA APIs. > > http://activemq.codehaus.org/JCA+Container [...] I understand that this is mainly targeted at integrating JMS. But I wonder how to combine this with a TM like JOTM? And a related question: does the JCA Container support JDBC CA Datasources, too? With other words: How does a combination of Spring + JOTM + JCA Container compare to a J2EE/EJB Server? cu, Olli --og |
|
From: <jas...@ma...> - 2004-10-28 14:39:13
|
On 28 Oct 2004, at 09:24, Oliver Geisser wrote: > Hi > > jas...@ma... wrote: > [...] > >> As part of the ActiveMQ project we've written a small, Spring based & >> easily embedded JCA container. Its just a few classes and is easy to >> use on any project, just depending on Spring and the JCA APIs. >> http://activemq.codehaus.org/JCA+Container > [...] > > I understand that this is mainly targeted at integrating JMS. > > But I wonder how to combine this with a TM like JOTM? FWIW there's an example in CVS now which uses JOTM directly for its TransactionManager. Just set the transactionManager property on the JCAContainer. > And a related question: does the JCA Container support JDBC CA > Datasources, too? The JCAContainer & JCAConnector classes have no JMS dependencies and so should work with any JCA ResourceAdapter. The only thing we've done is provide a default EndpointFactory which uses JMS by default; just set a different EndpointFactory on the JCAConnector bean and hey presto you're using anything else you like. > With other words: > > How does a combination of Spring + JOTM + JCA Container compare to > a J2EE/EJB Server? The biggest difference is there's no EJB :) James ------- http://radio.weblogs.com/0112098/ |
|
From: James C. <jim...@do...> - 2004-10-28 15:03:52
|
> > How does a combination of Spring + JOTM + JCA Container compare to > > a J2EE/EJB Server? >=20 > The biggest difference is there's no EJB :) Spring is all about J2EE development, except without the EJB part. = Spring does a lot of other nice things for you along the way also. The programming model is much simpler and "natural" as compared to EJB.=20 The Spring framework turns J2EE on its ear somewhat and provides = alternative mindsets (IoC vs. JNDI lookup) for many of the major J2EE features. It = does this without compromising your domain model the way that EJB does.=20 One of the few upsides (IMO) to a full-fledged EJB application are the deployment offerings. If you need a cluster of app servers with seamless failover support for all server resources (web sessions, SFSB, HA stubs, federated JNDI, etc.) then a commercial J2EE vendor (or jBoss) is closer = to your needs. [Note: that clustering and failover do not imply scalability -- actually they work against scalability in some respects. If your enterprise application need to scale, you can certainly develop them using = Spring/J2EE without EJB] |