I wish I have listened to Adrian Brock two years ago and made the integration loose. But we didn't have resourcing and timing back then.. so I kept working with the tight integration when I replaced JBossMQ by JBossMessaging. In the long term it costed more time and money.
I think the main thing is to make a proper integration on the testsuite. As Adrian said two years ago there are other scenarios that would get benefit of that such as testing with other providers.
I think we should do the proper integration test after HornetQ became GA.
On the JBM dev forum, Tim suggested I open a thread on planning for conversion of JBoss AS to use HornetQ in place of JBM.
AIUI, the intent is to use HornetQ in AS 6. Replacing the JMS server is a pretty big change, so we'd better plan for it.
I'm aware of 2 issue areas with the move to HornetQ. I'm sure there are others; these are just what I know about. Other people from the AS team are going to have to weigh in on this thread; I'm raising it because of a relatively small issue in the big picture.
1) Jason tells me the management stuff in AS 5 is pretty tightly coupled to JBM, so untangling it and making the switch will be a fair bit of work. I know no details.
I'm not really sure what that means
2) HornetQ does not use JGroups. From the AS clustering POV, this makes the switch simple; we just remove the JBM-specific JGroups configurations from the AS ChannelFactory. For AS clustering, the problem is more that leaving JBM in AS trunk causes hassles. We want to move to JGroups 2.8 ASAP, but the JBM issue described at  is blocking that. Also, as we move the AS to a unified end-user configuration model, dealing with the JBM-specific JGroups configs adds a (minor) wrinkle.
OK, so Howard (who leads the 1.4 stuff) can make the code change you suggested to make JBM work with JG 2.8
Tangent: it's theoretically possible to use HornetQ in the JBoss 5.2 expected out over the next few months, but Jason tells me issue #1 above is enough of a problem that that won't happen.
HornetQ already works with AS 5.1 (and 4.x). We have a simple script in the HornetQ distro that installs it in AS 5.1.
I know of several people using this already.
The same should work with 5..2
The big pieces of work in getting HornetQ in AS 6.0 as *default* messaging provider are:
a) Passing TCK
b) integrating it in the AS test suite - which is currently hardcoded to use JBM :(( That tight coupling in the AS test suite needs to be removed so it can be run easily against any JMS provider.