If you look at the branch as of late yesterday, you'll see that it mostly works which is pretty cool.
I'm now able to write a message and see that the the RA tries to pass it to the message listener. ActiveMQ seems to go into a weird loop here, haven't looked much closer yet. There's a couple of things I'd like to recommend. - Can TransactionManagerLookup be passed in via configuration, in addition to a serviceloader? So if it's not configured you leverage a service loader to resolve it? - ActiveMQ previously had a feature where the first time a destination was written to it was created. TomEE/OpenEJB seem to make heavy use of that, at least within tests. I would imagine the users do as well. Any chance that can be ported in? Currently AMQ6 will throw an exception if it doesn't exist. John On Sat Jan 03 2015 at 6:59:14 PM John D. Ament <[email protected]> wrote: > Yeah, I would imagine the final pass will make everything in Configuration > an option to the RA. For now, I'm just bypassing things until I get a good > grip on what's being passed in to the properties. > > For the scope of this (a POC), I ripped out AMQ 5.10 and dropped in 6. I > believe things are still up in the air, but I know there's a goal for JMS 2 > support in TomEE 2 and right now it doesn't make sense to try to backport > the JMS 2 APIs to the ActiveMQ codebase. > > John > > > On Sat Jan 03 2015 at 6:02:47 PM Clebert Suconic < > [email protected]> wrote: > >> You Probably need to configure security properly and pass the proper >> Principal? >> >> >> I will take a look on monday... I'm at the end of my vacations now and >> I won't be able to work over the weekend... >> >> >> Again... good stuff... >> >> >> BTW: Are you totally replacing ActiveMQ by 6 or you are making it >> optional? >> >> On Sat, Jan 3, 2015 at 2:19 PM, John D. Ament <[email protected]> >> wrote: >> > Little more info. >> > >> > Got past this part. Then hit an auth issue, turned off auth for now >> and I >> > at least see the connections making it (woo hoo!!). >> > >> > It looks like it passes back a proxy wrapper to the session, and not the >> > session itself. It looks like OpenEJB and ActiveMQ are both trying to >> > handle the closing of the session automatically. >> > >> > https://github.com/apache/tomee/blob/develop/container/opene >> jb-core/src/main/java/org/apache/openejb/resource/AutoCo >> nnectionTracker.java >> > >> > So ummm need to think about this a bit more. >> > >> > John >> > >> > On Sat Jan 03 2015 at 1:29:31 PM John D. Ament <[email protected]> >> > wrote: >> > >> >> Clebert, >> >> >> >> On Sat Jan 03 2015 at 1:11:57 PM Clebert Suconic < >> >> [email protected]> wrote: >> >> >> >>> That's great stuff you're doing... >> >>> >> >>> >> >>> Is there a branch we could try this? >> >>> >> >>> >> >> Sure, you can find it here: >> >> https://github.com/johnament/tomee/tree/activemq-6 >> >> >> >> You can see the test is called AMQXASupportTest, where I'm just trying >> to >> >> go through the steps that would bootstrap the RA. It's in the >> openejb-core >> >> module, the only things I've poked at thus far are around which >> classes are >> >> being invoked since there's lots of new packages and classes floating >> >> around (obviously). >> >> >> >> FWIW I had thought to use a similar approach I took last time I did an >> >> embedded HornetQ type solution, however that was an early 2.1/2.2 >> thing, >> >> and it looks like the 2.4 code base was a bit different for the non-JMS >> >> pieces. >> >> >> >> >> >>> >> >>> Perhaps there are dependencies that would need to be installed, and >> >>> old dependencies we still need to clear from the codebase? Did you >> >>> look at that? >> >>> >> >> >> >> I've thought about classloader issues, but I don't think that's the >> case >> >> yet. The fact that I'm seeing AMQ start up means that the code to >> boot the >> >> RA is working, it's simply not able to find the InVM connection that >> it's >> >> expecting. >> >> >> >> All maven dependencies were updated and locally I'm building off this >> >> branch: https://github.com/johnament/activemq-6/tree/geronimo-spec-jar >> >> but I don't think that makes much difference. >> >> >> >> Now it could also be that I was way off on my guesses for what the new >> >> classes are, but comparing the classes I picked from 6 to what TomEE >> used >> >> in 5.10 they appear to serve the same function. The only thing special >> >> about TomEE's RA (which extended AMQ 5.10's) was that they used the >> JDBC >> >> store for messages. For now that's not an issue for me so I avoided >> the >> >> sub-class for now. >> >> >> >> John >> >> >> >> >> >>> >> >>> On Sat, Jan 3, 2015 at 11:23 AM, John D. Ament <[email protected] >> > >> >>> wrote: >> >>> > I'm resending this as I had my emails messed up. Sorry for any >> >>> moderation >> >>> > issues. >> >>> > >> >>> > On Sat Jan 03 2015 at 11:06:43 AM John D. Ament < >> [email protected]> >> >>> > wrote: >> >>> > >> >>> >> Ok, so got a little bit further. I see the broker starting with >> the >> >>> in vm >> >>> >> connector. >> >>> >> >> >>> >> 659 [main] DEBUG org.apache.activemq.ra - Recovery Registry >> located = >> >>> >> org.apache.activemq.service.extensions.xa.recovery.ActiveMQR >> >>> egistryImpl@a530d0a >> >>> >> >> >>> >> 660 [main] DEBUG org.apache.activemq.ra - No connector params >> provided >> >>> >> using default >> >>> >> >> >>> >> 660 [main] DEBUG org.apache.activemq.ra - Creating Connection >> Factory >> >>> on >> >>> >> the resource adapter for >> >>> >> transport=[TransportConfiguration(name=8a3b9a30-9361-11e4-8f47- >> >>> bb448fce34db, >> >>> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> >>> ectorFactory) >> >>> >> ?server-id=0] with ha=false >> >>> >> >> >>> >> 660 [main] DEBUG org.apache.activemq.ra - No connector params >> provided >> >>> >> using default >> >>> >> >> >>> >> 660 [main] DEBUG org.apache.activemq.ra - Creating Recovery >> Connection >> >>> >> Factory on the resource adapter for >> >>> >> transport=[TransportConfiguration(name=8a3b9a32-9361-11e4-8f47- >> >>> bb448fce34db, >> >>> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> >>> ectorFactory) >> >>> >> ?server-id=0] >> >>> >> >> >>> >> 660 [main] DEBUG org.apache.activemq.ra - registering recovery for >> >>> >> factory : ActiveMQConnectionFactory [serverLocator=ServerLocatorIm >> pl >> >>> >> [initialConnectors=[TransportConfiguration(name=8a3b9a32- >> >>> 9361-11e4-8f47-bb448fce34db, >> >>> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> >>> ectorFactory) >> >>> >> ?server-id=0], discoveryGroupConfiguration=null], clientID=null, >> >>> >> consumerWindowSize = 1048576, dupsOKBatchSize=1048576, >> >>> >> transactionBatchSize=1048576, readOnly=false] >> >>> >> >> >>> >> 660 [main] INFO org.apache.activemq.ra - ActiveMQ resource adaptor >> >>> started >> >>> >> >> >>> >> >> >>> >> However, it looks like on connecting it fails. I see this log >> message >> >>> 10 >> >>> >> times >> >>> >> >> >>> >> >> >>> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - >> Trying >> >>> >> reconnection attempt 0/1 >> >>> >> >> >>> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - >> Trying >> >>> to >> >>> >> connect with connector = >> >>> >> org.apache.activemq.core.remoting.impl.invm.InVMConnectorFac >> >>> tory@6968dc8d, >> >>> >> parameters = {server-id=0} connector = null >> >>> >> >> >>> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - >> >>> Connector >> >>> >> towards org.apache.activemq.core.remoting.impl.invm.InVMConnector@ >> >>> 51aed0b7 >> >>> >> failed >> >>> >> >> >>> >> >> >>> >> with different factories and connectors. Finally the stack trace >> on >> >>> >> failure ends up looking like this: >> >>> >> >> >>> >> javax.jms.JMSException: Failed to create session factory >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.core.client.impl.ServerLocatorImpl.creat >> >>> eSessionFactory(ServerLocatorImpl.java:928) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> >>> ateConnectionInternal(ActiveMQConnectionFactory.java:673) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> >>> ateXAConnection(ActiveMQConnectionFactory.java:209) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> >>> ateXAConnection(ActiveMQConnectionFactory.java:204) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.ra.ActiveMQRAManagedConnection.setup(Act >> >>> iveMQRAManagedConnection.java:906) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.ra.ActiveMQRAManagedConnection.<init>(Ac >> >>> tiveMQRAManagedConnection.java:170) >> >>> >> >> >>> >> at >> >>> >> org.apache.activemq.ra.ActiveMQRAManagedConnectionFactory. >> >>> createManagedConnection(ActiveMQRAManagedConnectionFactory.java:164) >> >>> >> >> >>> >> >> >>> >> John >> >>> >> >> >>> >> On Sat Jan 03 2015 at 10:42:20 AM John D. Ament < >> [email protected] >> >>> > >> >>> >> wrote: >> >>> >> >> >>> >>> Hi, >> >>> >>> >> >>> >>> So I'm tinkering around a bit to port TomEE to use ActiveMQ 6 >> instead >> >>> of >> >>> >>> ActiveMQ 5.10, mostly so that we can do JMS 2.0 support. >> >>> >>> >> >>> >>> The original code is based around the original >> >>> ActiveMQResourceAdapter. >> >>> >>> I started porting the code over to use the new one, however I've >> run >> >>> into a >> >>> >>> hitch. >> >>> >>> >> >>> >>> If I leverage your resource adapter, I get an error: >> >>> >>> >> >>> >>> java.lang.IllegalArgumentException: must provide either >> >>> TransportType or >> >>> >>> DiscoveryGroupAddress and DiscoveryGroupPort for ActiveMQ >> >>> ResourceAdapter >> >>> >>> Connection Factory >> >>> >>> >> >>> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter. >> >>> >>> createActiveMQConnectionFactory(ActiveMQResourceAdapter.java >> :1987) >> >>> >>> >> >>> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter.setup( >> >>> >>> ActiveMQResourceAdapter.java:1788) >> >>> >>> >> >>> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter.start( >> >>> >>> ActiveMQResourceAdapter.java:261) >> >>> >>> >> >>> >>> >> >>> >>> However, there are no tests to show how to properly configure >> this, >> >>> and I >> >>> >>> can't find anything about using the resource adapter in the >> HornetQ >> >>> docs. >> >>> >>> For what I'm trying to do right now, the InVM connector is enough. >> >>> How >> >>> >>> would I configure the resource adapter to use the InVM connector? >> >>> >>> >> >>> >>> >> >>> >>> I'll aim to deal with the TCP based connectors later. >> >>> >>> >> >>> >>> Thanks, >> >>> >>> >> >>> >>> >> >>> >>> John >> >>> >>> >> >>> >> >> >>> >> >>> >> >>> >> >>> -- >> >>> Clebert Suconic >> >>> http://community.jboss.org/people/[email protected] >> >>> http://clebertsuconic.blogspot.com >> >>> >> >> >> >> >> >> -- >> Clebert Suconic >> http://community.jboss.org/people/[email protected] >> http://clebertsuconic.blogspot.com >> >
