On Jan 15, 2010, at 6:54 PM, Quintin Beukes wrote:
Hey,
I'll do this.
To use ActiveMQ with embedded OpenEJB, I just create a MDB and post
messages to it?
To test there are some unit tests that involve MDBs. There are a few
under openejb-core/src/test/java/org/apache/openejb/core/mdb. There
are also tests elsewhere for MDBs -- quite a lot in the iTests.
The work in question is largely on the classes mentioned below.
Initially it would be good enough to have a test case that ensured the
factory built the correct ActiveMQ resource adapter. Presuming it
does just that then all the other tests should still work.
Feel encouraged to keep asking questions. Rather impossible to give
an single answer that has all the info, so hopefully this is, to coin
a new acronym, ETKYG (Enough To Keep You Going).
-David
Quintin Beukes
On Thu, Jan 14, 2010 at 1:39 AM, David Blevins
<[email protected]> wrote:
On Jan 13, 2010, at 11:18 AM, Andy Gumbrecht wrote:
Is there a reason why such an 'old' activemq version is being
used? - 4.x
is really only for jdk1.4.
IIRC some package and class names changed between 4.x and 5.x so it
wasn't
possible to support them both without a bit of reflection (and
there really
wouldn't need to be much).
If someone wanted to give it a whirl here's the factory class that
creates
the broker:
http://svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
And I think it was the super class of this class that was moved
between 4.x
and 5.x:
http://svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactory.java
One approach might be to rename the "OpenEjbBrokerFactory" to
"ActiveMQ4BrokerFactory", create another that is
"ActiveMQ5BrokerFactory"
and have the ActiveMQResourceAdapter use reflection to try and load
each and
use the first one that loads. Or some flavor of that -- could take
the same
approach and have two different ActiveMQ${version}ResourceAdapter
factories
with a generic reflection based ActiveMQResourceAdapter factory.
-David