datasource with connection-properties using wildfly-maven-plugin

329 views
Skip to first unread message

Johan Ipsonious

unread,
Nov 18, 2022, 8:50:09 AM11/18/22
to WildFly
Hello,

I'm provisioning Wildfly using wildfly-maven-plugin and i have a layer that provisions a postgresql datasource. I can't find any documentation on how to set the <param name="connection-properties" value="what do i put here?"/> on the subsystem.datasources.data-source.connection-properties feature.

right now regardless of what i have put into value it will provision standalone.xml with only one connection-property with the name of the value and undefined as value like:
<connection-property name="what i put in param value">
undefined
</connection-property>

how do i configure. the layer spec to generate a standalone.xml with:
<connection-property name="loginTimeout>5</connection-property>
<connection-property name=connectionTimeout>5</connection-property>

Can anyone point me in the right direction?

James Perkins

unread,
Nov 18, 2022, 11:52:30 AM11/18/22
to WildFly
What goal are you using? There are a few ways to do it. Can you provide an example of what you're currently doing?

Mansour Al Akeel

unread,
Nov 19, 2022, 1:33:10 PM11/19/22
to WildFly

I would do it using jboss cli:

<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.1.0.Beta1</version>
<configuration>
<commands>
<command>/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql.jdbc,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)</command>
 </commands>
</configuration>
</plugin>

not tested. Let me know if it works

Johan Ipsonious

unread,
Nov 21, 2022, 3:58:23 AM11/21/22
to WildFly
So i managed to do it by myself after a lot of guessing and trying the correct syntax is this:

<feature spec="subsystem.datasources.data-source>
<feature spec="subsystem.datasources.data-source.connection-properties">
<param name="connection-properties" value="loginTimeout"/>
<param name="value" value="5"/>
</feature>
<feature spec="subsystem.datasources.data-source.connection-properties">
<param name="connection-properties" value="connectTimeout"/>
<param name="value" value="5"/>
</feature>
<feature spec="subsystem.datasources.data-source.connection-properties">
<param name="connection-properties" value="socketTimeout"/>
<param name="value" value="125"/>
</feature>
... rest of the datasource config
</feature>

Jean Francois Denise

unread,
Nov 21, 2022, 4:15:50 AM11/21/22
to wil...@googlegroups.com
Hi Johan,
You could have a look to the wildfly-datasources-galleon-pack project that defines Galleon layers for drivers and datasources:


JF
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/eee02d8e-9af5-439c-959d-1f33644880c9n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages