Multi-tenant
The Transact-TAFJ multi-menant architecture allows you to run multiple tenants within the same application deployment.
In the multi-tenant architecture, participants share the same application server resources and the Transact-TAFJ code base but use separated databases and configurations. JMS resources are shared and do not differ from a regular deployment. A common 'master' database is used for the Transact-TAFJ configuration. This database is not used for business purposes.
Multi-tenant in Inflow
In inflow, multi-tenancy is supported by a non-ESB solution (through the JMS queue). You need to implement a configuration that routes the request to a specific tenant.
The multi-tenancy concept exists at the repository (database) level, where each tenant has its own database layer. The application server specific configurations remain the same as those described in the Inflow user guide.
The following sections describe the configuration tasks you need to carry out to test multi-tenancy in inflow. Multi-tenancy inflow configurations are only carried out on the deployable artifact (that is, Inflow_EE.ear).
Inflow_EE Configurations in JBoss
The data source and tenant ids are mapped directly from the TAFJ_CONFIGURATIONS table. You need to configure both ejb-jar.xml and jboss-ejb3.xml. The number of the InflowListenerEJB session bean must be equal to the number of configured tenants. For example, if there are three tenants then you need to configure:
-
Three InflowListenerEJB session beans.
-
An InflowFailureRecoveryEJB session bean, where the data source of the master session bean points to the configured data source (which is highlighted in the following example code).
The following example configuration in ejb-jar.xml is for two tenants and one master database.
<session> <ejb-name>InflowListenerEjbTimer1</ejb-name> <ejb-class>com.temenos.technology.Inflow.listener.ejb.InflowListener</ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForInflowMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Min no of messages to be processed at a time</description> <env-entry-name>MinInflowPollSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>10</env-entry-value> </env-entry> <env-entry> <description>Max no of messages to be processed at a time</description> <env-entry-name>MaxInflowPollSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>15</env-entry-value> </env-entry> <env-entry> <description>Wait time before processing the same record</description> <env-entry-name>WaitTime</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>30</env-entry-value> </env-entry> <resource-ref> <description>Used to get connections from T24 jdbc pool</description> <res-ref-name>jdbc/t24DataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session>
<session> <ejb-name>InflowListenerEjbTimer2</ejb-name> <ejb-class>com.temenos.technology.Inflow.listener.ejb.InflowListener</ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForInflowMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Min no of messages to be processed at a time</description> <env-entry-name>MinInflowPollSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>10</env-entry-value> </env-entry> <env-entry> <description>Max no of messages to be processed at a time</description> <env-entry-name>MaxInflowPollSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>15</env-entry-value> </env-entry> <env-entry> <description>Wait time before processing the same record</description> <env-entry-name>WaitTime</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>30</env-entry-value> </env-entry> <env-entry> <description>Tenant Id</description> <env-entry-name>tenantId</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>t1</env-entry-value> </env-entry> </session>
<session> <ejb-name>InflowListenerEjbTimer3</ejb-name> <ejb-class>com.temenos.technology.Inflow.listener.ejb.InflowListener</ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForInflowMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Min no of messages to be processed at a time</description> <env-entry-name>MinInflowPollSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>10</env-entry-value> </env-entry> <env-entry> <description>Tenant Id</description> <env-entry-name>tenantId</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>t2</env-entry-value> </env-entry> </session>
<session> <ejb-name>InflowFailureRecoveryEjbTimer1</ejb-name> <ejb-class>com.temenos.technology.Inflow.failure.recovery.ejb.InflowFailureRecoveryTimer </ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForFailedRetriableMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Wait time before processing the same record</description> <env-entry-name>RetryWaitTime</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>30</env-entry-value> </env-entry> <env-entry> <description>Maximum number of times a failed message is eligible for processing</description> <env-entry-name>RetryCount</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>3</env-entry-value> </env-entry> <resource-ref> <description>Used to get connections from T24 jdbc pool</description> <res-ref-name>jdbc/t24DataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session>
<session> <ejb-name>InflowFailureRecoveryEjbTimer2</ejb-name> <ejb-class>com.temenos.technology.Inflow.failure.recovery.ejb.InflowFailureRecoveryTimer </ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForFailedRetriableMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Wait time before processing the same record</description> <env-entry-name>RetryWaitTime</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>30</env-entry-value> </env-entry> <env-entry> <description>Maximum number of times a failed message is eligible for processing</description> <env-entry-name>RetryCount</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>3</env-entry-value> </env-entry> <env-entry> <description>Tenant Id</description> <env-entry-name>tenantId</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>t1</env-entry-value> </env-entry> </session>
<session> <ejb-name>InflowFailureRecoveryEjbTimer3</ejb-name> <ejb-class>com.temenos.technology.Inflow.failure.recovery.ejb.InflowFailureRecoveryTimer </ejb-class> <session-type>Singleton</session-type> <timer> <schedule> <second>0/5</second> <minute>*</minute> <hour>*</hour> </schedule> <timeout-method> <method-name>pollForFailedRetriableMessage</method-name> <method-params> <method-param>javax.ejb.Timer</method-param> </method-params> </timeout-method> <persistent>false</persistent> </timer> <transaction-type>Bean</transaction-type> <env-entry> <description>Wait time before processing the same record</description> <env-entry-name>RetryWaitTime</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>30</env-entry-value> </env-entry> <env-entry> <description>Maximum number of times a failed message is eligible for processing</description> <env-entry-name>RetryCount</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>3</env-entry-value> </env-entry> <env-entry> <description>Tenant Id</description> <env-entry-name>tenantId</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>t2</env-entry-value> </env-entry> </session>
An example configuration in jboss-ejb3.xml:
<session>
<ejb-name>InflowListenerEjbTimer1</ejb-name>
<resource-ref>
<res-ref-name>jdbc/t24DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/jdbc/t24DS</jndi-name>
</resource-ref>
</session>
<session>
<ejb-name>InflowFailureRecoveryEjbTimer1</ejb-name>
<resource-ref>
<res-ref-name>jdbc/t24DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/jdbc/t24DS</jndi-name>
</resource-ref>
</session>
In this topic