-
1. Resource Adapter integration on AS7
clebert.suconic Apr 25, 2011 8:53 PM (in response to clebert.suconic)I've been talking to Jason and David Lloyd today on IRC, and they want something on the integration layer to instantiate and add the Resource Adapter manually into the JCA API.
The RA is by definition today a deployment unit, however they don't want HornetQ to be a deployment unit. What would be fine as we would have a lot of control about when the RA will start (like, before the destinations are started).
We could however have users wanting to deploy a new instance of the HornetQ resource adapter to support remote servers. Maybe we can think of that scenario later...
And we already have the need to define multiple datasources.
Also: We will also need to install the TM recovery automatically via the Resource Adapter. Something that's not currently being done. (We currently need the classname in some configuration).
-
2. Re: Resource Adapter integration on AS7
jesper.pedersen Apr 26, 2011 8:44 AM (in response to clebert.suconic)<subsystem xmlns="urn:jboss:domain:resourceadapters:1.0">
The resource-adapters subsystem is for configuration of resource adapter deployments.
The JCA subsystem will pick up .rar files, and register their metadata in the container. The resource-adapters subsystem can then be used to configure instances on the resource adapter in question.
<resource-adapter> <archive>hornetq.rar</archive> <transaction-support>XATransaction</transaction-support> <connection-definitions> <connection-definition class-name="com.example.ra.MCF" jndi-name="java:/eis/example" pool-name="MyCF"/> </connection-definitions> </resource-adapter>
That will configure a connection factory from the hornetq.rar and bind it into the specified JNDI name.
-
3. Re: Resource Adapter integration on AS7
jesper.pedersen Apr 26, 2011 8:54 AM (in response to clebert.suconic)I've been talking to Jason and David Lloyd today on IRC, and they want something on the integration layer to instantiate and add the Resource Adapter manually into the JCA API.
The RA is by definition today a deployment unit, however they don't want HornetQ to be a deployment unit. What would be fine as we would have a lot of control about when the RA will start (like, before the destinations are started).
We could however have users wanting to deploy a new instance of the HornetQ resource adapter to support remote servers. Maybe we can think of that scenario later...
You will need something similar to the "datasources" subsystem which is a special schema for the configuration of datasources based on the JDBC resource adapter (used as a library) and the JCA container. That could serve as a starting point.
However, you'll need to expose the configuration parameters in the messaging subsystem such that the users can override the parameters they need, like JNDI names and so on.
And we already have the need to define multiple datasources.
What do you mean ? Datasources and resource adapters are two different subsystems starting from AS 7 - as it should be.
Also: We will also need to install the TM recovery automatically via the Resource Adapter. Something that's not currently being done. (We currently need the classname in some configuration).
All XA deployments will be registered for recovery automatically. However I would suggest that you provide your own implementation of
org.jboss.jca.core.spi.recovery.RecoveryPlugin
and use that with your configuration of the resource adapter instance. Otherwise the default implementation will be registered (based on the current product code).
-
4. Re: Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 10:20 AM (in response to jesper.pedersen)You will need something similar to the "datasources" subsystem which is a special schema for the configuration of datasources based on the JDBC resource adapter (used as a library) and the JCA container. That could serve as a starting point.
However, you'll need to expose the configuration parameters in the messaging subsystem such that the users can override the parameters they need, like JNDI names and so on.
It seems like we someone would need to develop the module on AS7. My expectation was to only develop the integration part, and this is a bit beyond just integration. We don't really have the resources.
-
5. Re: Resource Adapter integration on AS7
jesper.pedersen Apr 26, 2011 10:30 AM (in response to clebert.suconic)Why not do it as a two step thing ?
1) Get everything working using the hornetq.rar and a configuration inside the resource-adapters subsystem
2) Migrate to use the resource adapter as a library and specialize the configuration in the messaging subsystem (like the datasources subsystem)
-
6. Resource Adapter integration on AS7
jesper.pedersen Apr 26, 2011 10:37 AM (in response to jesper.pedersen)The XSD you'll need is: http://docs.jboss.org/ironjacamar/schema/resource-adapters_1_0.xsd
-
7. Re: Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 2:30 PM (in response to jesper.pedersen)The requirement I have from AS7 is quite simple: No /deploy for hornetq's resource adapter.
we may have cases where the user may want to deploy the RA as a separate entity, but that would be an exception. (Say someone wanting to deploy an older version of HornetQ for integration purposes on a remote server).
To fulfill that request we need a few things:
I - a proper integration point where we make a simple call such as:
AnyClass::registerCF(CFConfiguration)
II - We would need the same for the InBound on MDB
Notice that we will need to provide properties that will be passed to our ConnectionFactories also. The best would be if we could provide you a ConnectionFactory already that would be used in your pool creation.
III - you already have a parser somewhere to parse the resource-adapters_1_0.xsd schema. I would like to reuse that code also otherwise we would be duplicating code what could create headaches later.
-
8. Re: Resource Adapter integration on AS7
jason.greene Apr 26, 2011 2:40 PM (in response to clebert.suconic)III - you already have a parser somewhere to parse the resource-adapters_1_0.xsd schema. I would like to reuse that code also otherwise we would be duplicating code what could create headaches later.
What do we need to parse? Where would this config come from? Can't it just be POJO properties that are passed, (like in I)?
-
9. Re: Resource Adapter integration on AS7
jesper.pedersen Apr 26, 2011 2:44 PM (in response to jason.greene)It'll be based on the XML models of IronJacamar - which are modelled using POJOs. We can't have different models for the same stuff.
-
10. Re: Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 2:44 PM (in response to jason.greene)I'm looking for a POJO I can pass in to JCA module...
I would like to have a parser I could reuse to create the POJO. Jesper already have the POJO somewhere. If I could call this:
CFconfig config = parser.parse(XML);
And then I could add my hard-coded properties (such as class-name, etc)
III Is just a wish list, it is an optional item.
For having hornetq.rar as a module though, We definitely need I and II
-
11. Re: Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 2:48 PM (in response to jesper.pedersen)Jesper Pedersen wrote:
It'll be based on the XML models of IronJacamar - which are modelled using POJOs. We can't have different models for the same stuff.
At the moment you have a lot of stuff mixed with deployers, and not being a proper API.
We can call your POJOs. We just need proper calls, and we need to understand what to call.
So far I don't have the complete story. all I have so far is use the AbstractDeployer::deploy(URL, ... other stuff) that would clearly throw lots of exceptions.
- The fact that I have to call a Deployer outside a deployer is an issue
- Also: the method would clearly throw NPEs if we didn't pass URL and other stuff.
We need a clear definition about what to do anyway.
-
12. Re: Resource Adapter integration on AS7
jason.greene Apr 26, 2011 3:15 PM (in response to clebert.suconic)Clebert Suconic wrote:
I'm looking for a POJO I can pass in to JCA module...
I would like to have a parser I could reuse to create the POJO. Jesper already have the POJO somewhere. If I could call this:
CFconfig config = parser.parse(XML);
And then I could add my hard-coded properties (such as class-name, etc)
Yeah just keep in mind that xml has about the same verbosity as static java code, but with delayed validation/type safety, and it's way more expensive (with StAX parsing its not as bad, but its still way slower than pure java). IMO it's really only good for things we want users to edit.
-
13. Re: Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 3:39 PM (in response to jason.greene)We will basically have pool size, and Connection Factory properties (HornetQ internal properties)
-
14. Resource Adapter integration on AS7
clebert.suconic Apr 26, 2011 5:48 PM (in response to jesper.pedersen)Jesper Pedersen wrote:
It'll be based on the XML models of IronJacamar - which are modelled using POJOs. We can't have different models for the same stuff.
I misunderstood you...
Yeah.. we are looking for a way to use existent POJOs.
Lets talk tomorrow...