<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Infinispan-DSL+Data+Sources">Infinispan-DSL Data Sources</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://docs.jboss.org/author/display/~van.halbert">Van Halbert</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="Infinispan-DSLDataSources-InfinispanDSLDataSources"></a><b>Infinispan-DSL Data Sources</b></h1>

<p>Infinispan-DSL data sources use a Teiid specific JCA connector that is deployed into AS 7.2 (EAP 6.1 Alpha) during installation.  This connector can be configured to support the following modes of Infinispan caches that will be accessed using the Hot Rod client:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Cache Type </th>
<th class='confluenceTh'> Property Name </th>
<th class='confluenceTh'> Obtain Cache By </th>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> CacheJndiName </td>
<td class='confluenceTd'> using JNDI </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> RemoteServerList </td>
<td class='confluenceTd'> Server list, specify 1 or more host:port's </td>
</tr>
<tr>
<td class='confluenceTd'> Remote Cache </td>
<td class='confluenceTd'> HotRodClientPropertiesFile </td>
<td class='confluenceTd'> HotRod client properties file </td>
</tr>
</tbody></table>
</div>


<h2><a name="Infinispan-DSLDataSources-Requirement"></a>Requirement</h2>
<p>Minimum, Infinispan 6.0.1 (JDG 6.2) that is configured to use Google Protobuf for object serialization.  This will enable Teiid to query the cache as if it was a local cache configured with Lucene indexes.</p>

<h2><a name="Infinispan-DSLDataSources-Configuration"></a>Configuration</h2>
<p>The following are the properties that can be configured for this connector:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> <b>Property Name</b> </th>
<th class='confluenceTh'> <b>Req.</b> </th>
<th class='confluenceTh'> <b>Property Template</b> </th>
<th class='confluenceTh'> <b>Description</b> </th>
</tr>
<tr>
<td class='confluenceTd'> CacheTypeMap </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'> cacheName:className[;pkFieldName]  <br class="atl-forced-newline" />
[,cacheName:className[;pkFieldName]..] </td>
<td class='confluenceTd'> Map the root Java Object class name to the cache, and identify which attribute is the primary key to the cache. </td>
</tr>
<tr>
<td class='confluenceTd'> ProtobinFile </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Path to the Google Protobin file that's packaged in a jar </td>
</tr>
<tr>
<td class='confluenceTd'> MessageMarshallers </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'> marshaller [,marshaller,..] </td>
<td class='confluenceTd'> Class names for the message marshallers, (marshaller,[marshaller,..]), that are to be registered for serialization </td>
</tr>
<tr>
<td class='confluenceTd'> MessageDescriptor </td>
<td class='confluenceTd'> Y </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Message descriptor class name for the root object in cache </td>
</tr>
<tr>
<td class='confluenceTd'> module </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specify the JBoss AS module that contains the cache classes that need to be loaded </td>
</tr>
<tr>
<td class='confluenceTd'> CacheJndiName </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> JNDI name to find the CacheContainer </td>
</tr>
<tr>
<td class='confluenceTd'> RemoteServerList </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'> host:port[;host:port….] </td>
<td class='confluenceTd'> Specify the host and ports that will be clustered together to access the caches </td>
</tr>
<tr>
<td class='confluenceTd'> HotRodClientPropertiesFile </td>
<td class='confluenceTd'> N </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The HotRod properties file for configuring a connection to a remote cache </td>
</tr>
</tbody></table>
</div>


<p><b>Examples</b><br/>
There are many ways to create the data source, using CLI, <a href="/author/display/TEIID/AdminShell" title="AdminShell">AdminShell</a>, admin-console etc. The first example is an xml snippet of a resource-adapter that is used to connect to the JDG remote-query quick start:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Sample Resource Adapter</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
               &lt;resource-adapter id="infinispanRemQS"&gt;
                    &lt;module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.dsl"/&gt;
                    &lt;connection-definitions&gt;
                        &lt;connection-definition class-name="org.teiid.resource.adapter.infinispan.dsl.InfinispanManagedConnectionFactory" jndi-name="java:/infinispanRemote" enabled="true" use-java-context="true" pool-name="infinispanDS"&gt;
                            &lt;config-property name="CacheTypeMap"&gt;
                                addressbook:org.jboss.as.quickstarts.datagrid.hotrod.query.domain.Person;id
                            &lt;/config-property&gt;
                            &lt;config-property name="ProtobinFile"&gt;
                                /addressbook.protobin
                            &lt;/config-property&gt;
                            &lt;config-property name="MessageDescriptor"&gt;
                                quickstart.Person
                            &lt;/config-property&gt;
                            &lt;config-property name="Module"&gt;
                                com.client.quickstart.pojos
                            &lt;/config-property&gt;
                            &lt;config-property name="MessageMarshallers"&gt;                              org.jboss.as.quickstarts.datagrid.hotrod.query.domain.Person:org.jboss.as.quickstarts.datagrid.hotrod.query.marshallers.PersonMarshaller,org.jboss.as.quickstarts.datagrid.hotrod.query.domain.PhoneNumber:org.jboss.as.quickstarts.datagrid.hotrod.query.marshallers.PhoneNumberMarshaller,org.jboss.as.quickstarts.datagrid.hotrod.query.domain.PhoneType:org.jboss.as.quickstarts.datagrid.hotrod.query.marshallers.PhoneTypeMarshaller
                            &lt;/config-property&gt;
                            &lt;config-property name="RemoteServerList"&gt;
                                127.0.0.1:11322
                            &lt;/config-property&gt;
                        &lt;/connection-definition&gt;
                    &lt;/connection-definitions&gt;
                &lt;/resource-adapter&gt;
 </pre>
</div></div>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://docs.jboss.org/author/display/TEIID/Infinispan-DSL+Data+Sources">View Online</a>
              |
       <a href="https://docs.jboss.org/author/display/TEIID/Infinispan-DSL+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>