5 Replies Latest reply on Nov 24, 2015 9:30 AM by jesper.pedersen

    Couchbase data source configuration in WildFly

    arungupta

      WildFly has <datasource> element that configures a JDBC resource as:

       

      <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>         


      What would be an appropriate place in the configuration file to add a similar element to configure a Couchbase connection?


      It could be something like:


      <datasources>

                      <datasource jndi-name="java:couchbase/ExampleDS" enabled="true">

                          <connection-url>192.168.99.101</connection-url>

                          <security>

                              <user-name>user</user-name>

                              <password>user</password>

                          </security>

                      </datasource>

                  </datasources>         


      Does not have to be in <datasources>, would be nice if it can be resolved using JNDI but not necessarily a requirement. Any thing simplistic would do.


      How would this then be accessible in application?


      It may not have connection pooling or any of the advantages but will make application configuration familiar to developers using WildFly. It'll be great if this configuration can be added using jboss-cli.


      Thoughts?


      Arun