eap 6.1, same profile different datasource url
How can I define two different server groups to use the same profile except for the url of the datasource?
Do I have to copy the profile and make a single line edit? Ack!
Thanks,
John
Responses
You could try something like the following:
In your hosts config.
<servers>
<server name="server-one" group="main-server-group">
<system-properties>
<property name="datasource.url" value="jdbc:dummy"/>
</system-properties>
</server>
<server name="server-two" group="main-server-group" auto-start="true">
<socket-bindings port-offset="150"/>
<system-properties>
<property name="datasource.url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"/>
</system-properties>
then in your profile.
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>${datasource.url}</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
