wildfly-extras / wildfly-jar-maven-plugin

WildFly Bootable JAR
https://docs.wildfly.org/bootablejar/
Apache License 2.0
56 stars 40 forks source link

Examples do not contain case for platform independent datasource #228

Open wisteso opened 3 years ago

wisteso commented 3 years ago

Had to guess / experiment until I found a way that worked for bare-metal / non-openshift projects. The solution I found is posted as the answer to my own StackOverflow question

This also lets users have more than one datasource instead of a singleton-only approach like you see in the postgresql example

This might seem obvious to the development team, but it's is extremely unintuitive for someone that's new to WildFly or perhaps relied on the management console to define datasources previously.

jamezp commented 3 years ago

There is a layer you can use for this for this https://github.com/wildfly-extras/wildfly-datasources-galleon-pack. I believe in that example you can just remove the cloud layer.

jfdenise commented 3 years ago

@wisteso , thank-you for your report. We definitely need to evolve the postgresql example with a non cloud example. We will add it.You can use the same environment variables on openshift and on bare-metal BTW.

As @jamezp mentioned, we have a wildfly-datasources-galleon-pack (for which we are going to release a v2 very soon with much more configuration capabilities, new env variables, ability to configure the datasource with System properties), that defines a postgresql-datasource layer that would allow you to create a datasource for postgresql. It also supports mysql and oracle (in v2 we are adding microsoft mssqlserver and mariadb).

wisteso commented 3 years ago

@jfdenise That's great news on adding the additional example.

I could definitely use the env variable approach with wildfly-datasources-galleon-pack, but the 'data-source add' CLI command is also working great and lets me configure the JNDI name and have multiple datasources, if needed.

Sounds like v2 might address those issues too, so I'm looking forward to it. Though is there anything you see as an issue with the Githubissues.

  • Githubissues is a development platform for aggregating issues.