-
15. Re: Feedback on Narayana Spring integration required
gytis Jan 22, 2016 3:41 AM (in response to tomjenkinson)I've expected that question no I didn't start up the recovery manager yet. I'm planning to do it once all the APIs are integrated.
As of jbossts-properties.xml, it would be better IMO to use spring configuration file and add our main properties there. And maybe jbossts-properties.xml could be used to override them. What do you think?
-
16. Re: Feedback on Narayana Spring integration required
gytis Jan 22, 2016 3:47 AM (in response to tomjenkinson)There is nothing much in Atomikos [1] and Bitronix [2] integration classes, since they extend classes from their own repos. I don't have code for Atomikos, but Bitronix PoolingConnectionFactoryBean extends this class [3].
I've started implementing ConnectionFactory in spring boot to see if that would work [4].
[3] btm/PoolingConnectionFactory.java at master · bitronix/btm · GitHub
-
17. Re: Feedback on Narayana Spring integration required
tomjenkinson Jan 22, 2016 4:50 AM (in response to gytis)Gytis Trikleris wrote:
I've expected that question no I didn't start up the recovery manager yet. I'm planning to do it once all the APIs are integrated.
As of jbossts-properties.xml, it would be better IMO to use spring configuration file and add our main properties there. And maybe jbossts-properties.xml could be used to override them. What do you think?
You and zhfeng should talk (new thread in the Dev space) about the best way to do this as I know he has spent some time looking at it for JBTM-855 so would be good to do that consistently. What I suggested to him in his quickstart to have an example of two dummy XAResources with a System.exit in the commit of the first one then restart the quickstart and watch the recovery messages. But lets discuss that further in a new Spring recovery thread.
-
18. Re: Feedback on Narayana Spring integration required
tomjenkinson Jan 22, 2016 5:04 AM (in response to gytis)Looks like a good start. I would think Spring would do its own pooling so I think you are right to leave that out for now (https://github.com/spring-projects/spring-boot/compare/e2f5ecd2e8f4f44136fbb13bf5f3c00c5476e598...gytis:spring-boot-starter-jta-narayana)
One thing to consider is when you are passed the XAConnectionFactory, you could register it with our recovery manager - possibly you want to do this in config instead but it might be an option. That is the analog to how WildFly would do it.
-
19. Re: Feedback on Narayana Spring integration required
tomjenkinson Jan 22, 2016 5:06 AM (in response to gytis)Gytis Trikleris wrote:
As of jbossts-properties.xml, it would be better IMO to use spring configuration file and add our main properties there. And maybe jbossts-properties.xml could be used to override them. What do you think?
+1 - if you move to use the jta dependency rather than narayana-jta Narayana will start looking for arjuna-properties.xml as 1. jbossts-properties.xml is configured in the manifest of the uber jar and 2. the raw jta.jar does not include a default property file.
You could start a different non-Spring related discussion to what is best here. It won't cause an error for you at all but will have a WARN so we need to do something. I still think the maven way is to include the raw jar rather than the uber jar though as your debugger can't work as effectively.
-
20. Re: Feedback on Narayana Spring integration required
marklittle Jan 22, 2016 11:42 AM (in response to tomjenkinson)What's the link to the example and instructions on how to build?
-
21. Re: Feedback on Narayana Spring integration required
tomjenkinson Jan 22, 2016 2:39 PM (in response to marklittle)I don't think Gytis has completed his sample so it's not guaranteed to run yet. I have been providing comments after reviewing Gytis' diffs so far by eye on https://github.com/gytis/spring-boot/compare/master...spring-boot-starter-jta-narayana.
You could try cloning Gytis' repo git@github.com:gytis/spring-boot.git and then checking out his branch "spring-boot-starter-jta-narayana". Within there is a class with a public static void main: spring-boot/SampleNarayanaApplication.java at spring-boot-starter-jta-narayana · gytis/spring-boot · GitHub - maybe it runs but I haven't tried it myself just looked at it by eye.
-
22. Re: Feedback on Narayana Spring integration required
marklittle Jan 23, 2016 12:48 PM (in response to tomjenkinson)Thanks Tom. I'll wait until Gytis (and you) have an alpha version then I'll check it out. No need for me to add more noise at this stage.
-
23. Re: Feedback on Narayana Spring integration required
gytis Jan 25, 2016 3:08 AM (in response to marklittle)Tom is correct, it's still in progress. JDBC bit so far works fine (I haven enabled recovery yet, so cannot confirm that). However JMS connection is closed too early. It means I'm missing something in my connection implementation.
I'll post here once there is a functioning alpha for you to try out.
-
24. Re: Feedback on Narayana Spring integration required
marklittle Jan 25, 2016 7:41 AM (in response to gytis)OK, thanks Gytis.
-
25. Re: Feedback on Narayana Spring integration required
zhfeng Jan 26, 2016 3:46 AM (in response to tomjenkinson)I create the thread on the dev forum How to enlist a custom XAResouce in the spring and start the recovery manager service
we can discuss the best way to do the recovery work in the spring.
-
26. Re: Feedback on Narayana Spring integration required
gytis Feb 1, 2016 6:10 AM (in response to marklittle)I've just pushed the working code to my Github repository. Please let me know your thoughts.
First of all you need to build Narayana from my repo: https://github.com/gytis/narayana/tree/master-JBTM-2616-jms-integration. It's needed because I've added JMS integration module there https://github.com/gytis/narayana/tree/master-JBTM-2616-jms-integration/ArjunaJTA/jms.
After that, build Spring Boot: https://github.com/gytis/spring-boot/tree/spring-boot-starter-jta-narayana.
And finally, execute the sample application:
cd spring-boot-samples/spring-boot-sample-jta-narayana
mvn test
I've enabled trace logging for "com.arjuna", so you should see Narayana logs when you run the sample application.
p.s. I have not added recovery and configuration yet, because I wanted to make all the apis working and get some feedback from you first.
-
27. Re: Feedback on Narayana Spring integration required
tomjenkinson Feb 3, 2016 6:15 AM (in response to gytis)Both patches for Spring and Narayana (Comparing jbosstm:master...gytis:master-JBTM-2616-jms-integration · jbosstm/narayana · GitHub) look good to me. I don't think we should merge them till we have recovery working but its well on track
I created a pull on your repo as for some reason github no longer allows you to add comments on a branch with multiple commits outside of a pull: Spring boot starter jta narayana by tomjenkinson · Pull Request #1 · gytis/spring-boot · GitHub (its for your branch against your master so has all your commits and should be kept in sync).
I can't seem to build your fork of spring boot cleanly. One of the "spring boot" (module name) tests fails on my box but it could be an OS issue:
Failed tests:
SpringApplicationTests.customBannerWithProperties:221
Expected: a string starting with "Running a Test!\r\n\r\n123456"
but: was "Running a Test!
Then I get this error:
ERROR] Failed to execute goal on project spring-boot-starter-data-gemfire: Could not resolve dependencies for project org.springframework.boot:spring-boot-starter-data-gemfire:jar:1.3.2.BUILD-SNAPSHOT: Failed to collect dependencies at com.gemstone.gemfire:gemfire:jar:8.1.0: Failed to read artifact descriptor for com.gemstone.gemfire:gemfire:jar:8.1.0: Could not transfer artifact com.gemstone.gemfire:gemfire:pom:8.1.0 from/to repo.spring.io (http://repo.spring.io/libs-release): Permission denied: connect -> [Help 1]
-
28. Re: Feedback on Narayana Spring integration required
tomjenkinson Feb 3, 2016 6:25 AM (in response to tomjenkinson)Just to say that hacking out that module seems to have fixed the rest of the build and the sample runs well for me.
-
29. Re: Feedback on Narayana Spring integration required
zhfeng Feb 3, 2016 10:52 PM (in response to gytis)Nice work and it works on my machine.
I'm trying to apply the NarayanaDataSourceBean to the spring context xml configuration and it looks like the following:
<bean id="db" class="org.h2.jdbcx.JdbcDataSource"> <property name="user" value="sa" /> <property name="password" value="sa" /> <property name="url" value="jdbc:h2:file:test.db;MODE=Oracle;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE" /> </bean> <bean id="dataSource" class="org.springframework.boot.jta.narayana.NarayanaDataSourceBean> <constructor-arg ref="db"/> </bean>
It could be better if we can provide the get/set method of the xaDataSource, so the bean could config with
<bean id="dataSource" class="org.springframework.boot.jta.narayana.NarayanaDataSourceBean> <property name="xaDataSource" ref="db"/> </bean>
and I check our TransactionalDriver and it looks like if we pass the XADataSource, the ConnectionManager narayana/ConnectionImple.java at master · jbosstm/narayana · GitHubwill create a ProvidedXADataSourceConnection narayana/ProvidedXADataSourceConnection.java at master · jbosstm/narayana · GitHub which might not be recovered directly.
I'm not sure that we need to provider the XAResourceRecovery to help during the recovering work.
Also if we pass the Dynamical class, it will create narayana/DirectRecoverableConnection.java at master · jbosstm/narayana · GitHub and this looks good to recovery.