-
1. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Nov 26, 2008 4:52 AM (in response to jesper.pedersen)Thanks Jesper-
The main thing is *no connection consumer*. Connection consumer was always a horrible abstraction and broken with respect to consumption in an XA transaction (See Mark Little's transaction book).
Clearly we need to support the JCA mandated config properties.
Regarding the ones currently used in the generic resource adapter:
user and password are still useful
max messages and max session - these can probably go
keepalive, reconnectinterval can go - JBM 2 handles its own automatic reconnection
deliveryactive - ok
All the dlq stuff can go - JBM has its own sophisticated dlq system
I'm thinking this is going to be relatively simple wrapper around the core API.
http://anonsvn.jboss.org/repos/messaging/trunk/src/main/org/jboss/messaging/core/client/
The core API is easy to understand if you've used JMS before. It's simpler than JMS.
Initially I'm thinking a 1-1 mapping between MDB instance and core session.
How about you start with a design proposal and we can develop from there... -
2. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Nov 26, 2008 12:15 PM (in response to jesper.pedersen)max messages and max session - these can probably go
These are used in the inflow part of the resource adaptor currently (in the class that implements javax.jms.ServerSessionPool).All the dlq stuff can go - JBM has its own sophisticated dlq system
The DLQ functionality is also used in the inflow part - just for your information.
Thanks for the pointer to the internal API - I'll look it over and post some design.
I think we should aim for a solution that uses as much of the existing resource adaptor as possible for the first beta. After getting it up and running we can start to make optimizations. -
3. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Nov 26, 2008 12:18 PM (in response to jesper.pedersen)"jesper.pedersen" wrote:
These are used in the inflow part of the resource adaptor currently (in the class that implements javax.jms.ServerSessionPool).
Can you take me through why that is necessary?
The DLQ functionality is also used in the inflow part - just for your information.
Hmmm, JBM already has DLQ I don't follow why this would be necessary for a JBM 2.0 only RA... -
4. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Nov 26, 2008 12:22 PM (in response to jesper.pedersen)javax.jms.ServerSessionPool was part of the JMS ASF (application server facilities) monstrosity classes from the JMS spec.
Since we won't be using connection consumer, this should definitely not be necessary:
http://java.sun.com/javaee/5/docs/api/javax/jms/ServerSessionPool.html -
5. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Nov 26, 2008 2:54 PM (in response to jesper.pedersen)I'm not saying that implementing ServerSessionPool will be necessary for the JBM 2.0 resource adaptor.
The current adaptor has a pool of sessions for each activation<inbound-resourceadapter> <messageadapter> <messagelistener> <messagelistener-type>javax.jms.MessageListener</messagelistener-type> <activationspec> <activationspec-class>org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</activationspec-class> <required-config-property> <config-property-name>destination</config-property-name> </required-config-property> </activationspec> </messagelistener> </messageadapter> </inbound-resourceadapter>
You can follow the flow JmsActivationSpec -> JmsActivation -> JmsServerSessionPool -> JmsServerSession (this class implements javax.jms.MessageListener).
I'm looking through your API currently and will post the initial design after big Turkey day holiday. -
6. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Dec 3, 2008 11:35 AM (in response to jesper.pedersen)Just a quick question - do I need to use the client.impl classes ?
ClientSessionFactory csf = new ClientSessionFactoryImpl(discoveryGroupName, discoveryGroupPort);
Or can I get an instance of the interface from somewhere ?
btw - DLQ handling will properly be mandatory in JCA 1.6 if an endpoint isn't available to the resource adaptor - so I keep the functionality around.
For now I have the classes in org.jboss.messaging.ra and sub-packages. -
7. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Dec 3, 2008 11:51 AM (in response to jesper.pedersen)"jesper.pedersen" wrote:
Just a quick question - do I need to use the client.impl classes ?ClientSessionFactory csf = new ClientSessionFactoryImpl(discoveryGroupName, discoveryGroupPort);
Or can I get an instance of the interface from somewhere ?
I'm not sure what you mean. That is an instance of the interface...
btw - DLQ handling will properly be mandatory in JCA 1.6 if an endpoint isn't available to the resource adaptor - so I keep the functionality around.
Can you explain a bit more what endpoint isn't available means?
For now I have the classes in org.jboss.messaging.ra and sub-packages.
ok -
8. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Dec 3, 2008 12:16 PM (in response to jesper.pedersen)I'm not sure what you mean. That is an instance of the interface...
Ok, so I need to pass discoveryGroupName and discoveryGroupPort in through the configuration.Can you explain a bit more what endpoint isn't available means?
In this case it would be that a Message Driven Bean (endpoint) isn't available or failed to handle the incoming message.public void onMessage(Message message) { try { endpoint.beforeDelivery(JBMActivation.ONMESSAGE); try { if (dlqHandler == null || dlqHandler.handleRedeliveredMessage(message) == false) { MessageListener listener = (MessageListener) endpoint; listener.onMessage(message); } } finally { endpoint.afterDelivery(); if (dlqHandler != null) dlqHandler.messageDelivered(message); } } catch (Throwable t) { log.error("Unexpected error delivering message " + message, t); if (txnStrategy != null) txnStrategy.error(); } }
-
9. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Dec 3, 2008 12:22 PM (in response to jesper.pedersen)"jesper.pedersen" wrote:
I'm not sure what you mean. That is an instance of the interface...
Ok, so I need to pass discoveryGroupName and discoveryGroupPort in through the configuration.
There are several ways you can instantiate a session factory. One is by specifying a discovery address on which it can listen, or you can specify the server connection info straight out, or a list of servers and backup servers...
Take a look a the constructors on ClientSessionFactoryImpl - we probably need all the ClientSessionFactory attributes configurable via the JCA config.Can you explain a bit more what endpoint isn't available means?
In this case it would be that a Message Driven Bean (endpoint) isn't available or failed to handle the incoming message.
I'm not sure I follow. This RA is for JBM 2 only, and JBM 2 always has DLQ functionality.... -
10. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Dec 3, 2008 12:32 PM (in response to jesper.pedersen)BTW I'll need to add you as a committer so you can commit in the JBM source tree.
Also, join us on IRC - that's where everything happens and everyone hangs out - it's much more efficient than forums. -
11. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Dec 10, 2008 6:18 AM (in response to jesper.pedersen)Hi Jesper-
Any feedback? -
12. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Dec 10, 2008 9:45 AM (in response to jesper.pedersen)I'm in a meeting all week - I'll try and catch you next week on IRC...
-
13. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
timfox Dec 10, 2008 9:49 AM (in response to jesper.pedersen)I'm away from end of this week until January 16th.
We really need to get this done this week. -
14. Re: [JBMESSAGING-1367] Create JCA resource adapter for JBM 2
jesper.pedersen Jan 9, 2009 10:27 AM (in response to jesper.pedersen)So I'm working on this again...
I'm focusing on the outbound part of the adaptor first - which exposes the JMS 1.1 API.
Looking at ClientSessionFactoryImpl there are a lot of constructors - some with composite datatypes (such as TransportConfiguration) - so I think I'll focus on thepublic ClientSessionFactoryImpl(final String discoveryGroupName, final int discoveryGroupPort) throws Exception
first. We can add support for the others along the way.
FYI - configuration parameters to the resource adaptor are passed in through the ra.xml file - f.ex.<config-property> <description>The discovery group name</description> <config-property-name>DiscoveryGroupName</config-property-name> <config-property-type>java.lang.String</config-property-type> <config-property-value>myValue</config-property-value> </config-property>
Or is there a better way to initialize the client API and get a ClientSession ?