Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

3.11. Resource Adapters

3.11.1. Resource Adapters in JBoss Data Virtualization

With the exception of JDBC data sources, JBoss Data Virtualization provides a JCA adapter for each supported data source. These are the resource adapter identifiers, as specified in the server configuration file:
  • File Adapter - file
  • Google Spreadsheet Adapter - google
  • LDAP Adapter - ldap
  • Salesforce Adapter - salesforce
  • Salesforce 34 Adapter - salesforce-34
  • Web Services Adapter - webservice
  • MongoDB Adapter - mongodb
  • Cassandra Adapter - cassandra
  • Accumulo Adapter - accumulo
  • Solr Adapter - solr
  • Couchbase Adapter - couchbase
  • Infinispan Hotrod Adapter (not added by default) - infinispan-hotrod

Note

A resource adapter for the JDBC translator is provided with Red Hat JBoss EAP by default.

3.11.2. Configuring Resource Adapters

You can use Management Console, AdminShell, or Management CLI (or, in standalone mode, directly edit the server configuration file) to configure resource adapters for data sources required by a VDB.

Note

Note that in domain mode, you must use Management CLI, Management Console or AdminShell to configure data sources. Refer to the JBoss Enterprise Application Platform Administration and Configuration Guide for an example of how to configure resource adapters using the Management Console.

Important

If you configure a resource adapter using either a CLI script or the AdminShell, the name of the resource adapter must not be the same as that of an existing one. (Teiid Designer handles this by creating a unique name for the resource adapter.)
The reasons for this are as follows:
  • Any time a resource adapter with a duplicate name is added, the server has to be restarted. This conforms with the way Red Hat JBoss EAP's JCA system was designed, in that multiple instances of resource adapters with the same name are only recognised when the server is launched.
  • Anytime you delete a resource adapter by name, all instances with the same name will be deleted.

3.11.3. Example Configuration

Example configuration, as it would appear in the server configuration file, can be found in the EAP_HOME/docs/teiid/datasources/ directory.

Note

This configuration will need to be adjusted with file paths and properties appropriate to your installation. The JNDI name must be the same JNDI name used in the VDB.

3.11.4. Resource Adapter Properties

For a full listing of configuration properties, you can run the following command from within the Management CLI:
/subsystem=teiid:read-rar-description(rar-name=ADAPTER_ID)
ADAPTER_ID refers to the identifier of the resource adapter as specified in the server configuration file.

3.11.5. Configuring Resource Adapters Using CLI Scripts

This is the preferred method for configuring resource adapters.
JBoss Data Virtualization provides an example Management CLI script for configuring each of the provided resource adapters. A script for a particular resource adapter can be found in the EAP_HOME/docs/teiid/datasources/DATASOURCE directory.
When configuring resource adapters using the Management CLI, you must provide a properties file. Sample properties files are provided in the same directory as the sample scripts.
You can run these scripts (once JBoss Data Virtualization is running) by executing the following command:
./EAP_HOME/bin/jboss-cli.sh --connect --file=EAP_HOME/docs/teiid/datasources/DATASOURCE/SCRIPT.cli --properties=EAP_HOME/docs/teiid/datasources/DATASOURCE/SCRIPT.properties
For more information about using the Management CLI, see the JBoss Enterprise Application Platform Administration and Configuration Guide.

Note

These scripts will need to be adjusted with file paths and properties appropriate to your installation. The JNDI name must be the same JNDI name used in the VDB.