Results 1 to 4 of 4

Thread: Spring 2.5.3 JCA JMS and WebSphere 6.1

  1. #1
    Join Date
    May 2008
    Posts
    2

    Default Spring 2.5.3 JCA JMS and WebSphere 6.1

    Hi,

    has anybody out there successfully configured to use springs (2.5.3 ) JCA endpoint support with WebSphere 6.1 (or 6.0) SIBus default messaging provider? I am currently stuck in confusion regarding the ResourceAdapter. The examples I have seen so far show how it can be done on Geronimo (and that Weblogic exposes the RA via JNDI) but I have not found a way to get an instance in WebSphere. I know how to get the queue destination and the activation spec but not the RA.

    Any hints are appreciated

    Regards,
    Philipp

  2. #2
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    466

    Default

    Hi,

    I have no answer to your specific question, only a lot of bad experiences trying to use Spring-related stuff with WAS. I'm afraid the WAS is to blame, I*M puts a lot of non-spec things into their products. I have changed to Tomcat at work, and it's working like a charm...
    Search the forum for WebSphere you'll see.
    Good luck!
    Sincerely,
    /The Cantor

    "Murphy was an optimist"
    (The O'Toole commentary on Murphy's Law)

  3. #3
    Join Date
    May 2008
    Posts
    2

    Default

    Hmm.. Thanks for your answer but it is not really satisfying , indeed. I was supposing that JCA should work on WebSphere since some of the JmsJca classes of Spring (like StandardJmsActivationSpecFactory) contain WebSphere specific code. I am really wondering why they put WebSphere detection code in there although there is no way to get in working on it.

    May be someone from the development team can explain?

    Thanks,

    Philipp

  4. #4
    Join Date
    May 2008
    Posts
    1

    Thumbs up

    I have achieved success with the following configuration and code:

    Spring 2.5.4 (also worked for 2.5.0 RC1)
    WAS 6.1.13

    Code:
    	<bean id="wasDefaultWorkManager" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
    		<property name="workManagerName" value="wm/default" />
    	</bean>
    	
    	<bean id="wasSIBJMSResourceAdapter" class="org.springframework.jca.support.ResourceAdapterFactoryBean">
    		<property name="resourceAdapter">
    			<bean class="com.ibm.ws.sib.api.jmsra.impl.JmsJcaResourceAdapterImpl"/>
    		</property>
    		<property name="workManager">
    			<bean class="org.springframework.jca.work.SimpleTaskWorkManager">
    				<property name="asyncTaskExecutor" ref="wasDefaultWorkManager" />
    			</bean>
    		</property>
    	</bean>
    
    	<bean id="myQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
    		<property name="jndiName" value="jms/myQueue"/>
    	</bean>
    	
    	<bean id="myDelegate" class="com.acme.DelegateImpl"/>
    	
    	<bean id="myListenerAdapter" class="com.acme.ListenerAdapter">
    		<property name="delegate" ref="myDelegate" />
    		<property name="defaultListenerMethod" value="handleMessage" />
    	</bean>
    
    	<bean class="org.springframework.jms.listener.endpoint.JmsMessageEndpointManager">
    		<property name="resourceAdapter" ref="wasSIBJMSResourceAdapter"/>
    		<property name="activationSpec">
    			<bean class="com.ibm.ws.sib.api.jmsra.impl.JmsJcaActivationSpecImpl">
    				<property name="destination" ref="myQueue"/>
    				<property name="destinationType" value="javax.jms.Queue"/>
    				<property name="busName" value="AcmeBus"/>
    				<property name="maxConcurrency" value="5"/>
    			</bean>
    		</property>
    		<property name="messageListener" ref="myListenerAdapter"/>
    	</bean>
    As explained here, usually a JMS Listener is enough. In our case the driver for using JCA was to take advantage of WAS SIB "retry interval" feature, only available on JCA route. To that effect the above configuration achieved the goal.

    A few gotchas:

    1. If you proxy myQueue bean, WAS will complain about the type.
    2. I had to overload Spring's MessageListenerAdapter.handleListenerException method so as to have rollback to queue working when I threw a RuntimeException from myDelegate bean. I implemented the solution offered here.
    3. If you only need local transaction like me above is enough. I tried JTA transaction by setting transactionManager=WebsphereUowTransactionManager on JCA Listener, but got a Spring exception complainining about not finding a JTA transaction.

    Enjoy!

    Roberto.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •