The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

vyurik (76) [Avatar] Offline
#1
Hi Ken,
Since I am interested in running effective microservices integration test, I wrote a small application similar to the admin app of Chapter 8.The data model is aroung a Product Entity that is simpler to your Category entity.
1. First, I was running against embedded H2 like admin app of Chapter 8 with Admin DS. With this simple Product Entity I had a problem org.h2.jdbc.JdbcSQLException: Data conversion error converting first record in load.sql to the product table.
I attached a document describing details of this process.
2. I tried unsuccessfully to create my own datasource java:/jboss/datasources/ProductDS instead of using AdminDS, but could not find reliable documentation on how to create a DS with Wildfly-Swarm.
3. Since in-memory databases are never used in production, I wanted to try to use H2 standalone and MySQL running on my PC. Although I found this piece of info https://howto.wildfly-swarm.io/create-a-datasource/, all it talked was about in-memory H2.
There is also this piece of info: https://github.com/wildfly-swarm/wildfly-swarm-examples/blob/master/datasource/datasource-war/src/main/resources/project-mysql.yaml related to MySQL but it didn't work for me.
I think it's important to present (probably in Addendum) workinng examples of standalone databases and drivers configuration with Wildfly-Swarm.

Vitaly
Ken Finnigan (21) [Avatar] Offline
#2
Vitaly,

Thanks for the input.

I'm presently going through and updating a bunch of examples, some of which are for Chapter 10, that show how to configure WF Swarm to connect to an external MySQL database.

In addition, http://docs.wildfly-swarm.io/2018.2.0/#configuring-a-datasource should cover what you need to configure a DataSource. Although the example uses "h2", you can replace it with "mysql" and provide a MySQL JDBC driver as a dependency of your project.

If you don't think the documentation is clear enough as to how that should work, please raise an issue at https://issues.jboss.org/browse/SWARM

Thanks
Ken
vyurik (76) [Avatar] Offline
#3
Hi Ken,
Thanks for your reply.
Vitaly