You are viewing the documentation for Blueriq 13. Documentation for other versions is available in our documentation directory.
Enabling multi-tenancy
blueriq.multi-tenancy.enabled=true blueriq.multi-tenancy.allowed-tenants=google,apple
For additional information, please refer to Multi-tenancy Properties
Configure components
The datasources for the components can be configured either in the application-externaldatasources.properties
file or the application-jndidatasources.properties
. When configuring external datasources, the externaldatasources
profile should be enabled. When configuration JNDI datasources the jndidatasources
profile should be enabled.
JDBC datasources
### Comments SQL Store ### blueriq.datasource.comments-sql-store.tenants.google.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.comments-sql-store.tenants.google.username=google blueriq.datasource.comments-sql-store.tenants.google.password=welcome blueriq.datasource.comments-sql-store.tenants.google.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.datasource.comments-sql-store.tenants.apple.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.comments-sql-store.tenants.apple.username=apple blueriq.datasource.comments-sql-store.tenants.apple.password=welcome blueriq.datasource.comments-sql-store.tenants.apple.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.hibernate.comments-sql-store.hbm2ddl.auto=validate blueriq.hibernate.comments-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect ### Process SQL Store ### blueriq.datasource.process-sql-store.tenants.google.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.process-sql-store.tenants.google.username=google blueriq.datasource.process-sql-store.tenants.google.password=welcome blueriq.datasource.process-sql-store.tenants.google.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.datasource.process-sql-store.tenants.apple.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.process-sql-store.tenants.apple.username=apple blueriq.datasource.process-sql-store.tenants.apple.password=welcome blueriq.datasource.process-sql-store.tenants.apple.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.hibernate.process-sql-store.hbm2ddl.auto=validate blueriq.hibernate.process-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect ### Trace SQL Store ### blueriq.datasource.trace-sql-store.tenants.google.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.trace-sql-store.tenants.google.username=google blueriq.datasource.trace-sql-store.tenants.google.password=welcome blueriq.datasource.trace-sql-store.tenants.google.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.datasource.trace-sql-store.tenants.apple.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.datasource.trace-sql-store.tenants.apple.username=apple blueriq.datasource.trace-sql-store.tenants.apple.password=welcome blueriq.datasource.trace-sql-store.tenants.apple.driverClassName=oracle.jdbc.driver.OracleDriver blueriq.hibernate.trace-sql-store.hbm2ddl.auto=validate blueriq.hibernate.trace-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect
JNDI datasources
### Comments SQL Store ### blueriq.datasource.comments-sql-store.tenants.google.jndiName=java:/comp/env/jdbc/google blueriq.datasource.comments-sql-store.tenants.apple.jndiName=java:/comp/env/jdbc/apple blueriq.hibernate.comments-sql-store.hbm2ddl.auto=validate blueriq.hibernate.comments-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect ### Process SQL Store ### blueriq.datasource.process-sql-store.tenants.google.jndiName=java:/comp/env/jdbc/google blueriq.datasource.process-sql-store.tenants.apple.jndiName=java:/comp/env/jdbc/apple blueriq.hibernate.process-sql-store.hbm2ddl.auto=validate blueriq.hibernate.process-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect ### Trace SQL Store ### blueriq.datasource.trace-sql-store.tenants.google.jndiName=java:/comp/env/jdbc/google blueriq.datasource.trace-sql-store.tenants.apple.jndiName=java:/comp/env/jdbc/apple blueriq.hibernate.trace-sql-store.hbm2ddl.auto=validate blueriq.hibernate.trace-sql-store.dialect=org.hibernate.dialect.Oracle12cDialect
DCM Lists Service
When multi-tenancy is enabled, the runtime will send the X-TENANT-ID
HTTP header to the DCM lists service whenever an HTTP request is made. To use a separate RabbitMQ instance for each tenant, additional configuration is required in application-dcm-lists-client.properties
.
blueriq.dcm.lists-client.rabbitmq.tenants.google.host=localhost blueriq.dcm.lists-client.rabbitmq.tenants.google.port=5672 blueriq.dcm.lists-client.rabbitmq.tenants.google.username=google blueriq.dcm.lists-client.rabbitmq.tenants.google.password=welcome blueriq.dcm.lists-client.rabbitmq.tenants.google.exchangeName=processEvents blueriq.dcm.lists-client.rabbitmq.tenants.google.virtualHost=google blueriq.dcm.lists-client.rabbitmq.tenants.google.queueNames=dcmListsService blueriq.dcm.lists-client.rabbitmq.tenants.apple.host=localhost blueriq.dcm.lists-client.rabbitmq.tenants.apple.port=5672 blueriq.dcm.lists-client.rabbitmq.tenants.apple.username=apple blueriq.dcm.lists-client.rabbitmq.tenants.apple.password=welcome blueriq.dcm.lists-client.rabbitmq.tenants.apple.exchangeName=processEvents blueriq.dcm.lists-client.rabbitmq.tenants.apple.virtualHost=apple blueriq.dcm.lists-client.rabbitmq.tenants.apple.queueNames=dcmListsService
DCM / Case Engine
The DCM module provides the Service call type: DCM_CaseCreate service call type that you can use to start a case by publishing data on a queue. The Case Engine will consume messages from the queue and start the case asynchronously. Below are examples on how to configure the RabbitMQ instance for each tenant.
blueriq.dcm.rabbitmq.tenants.google.host=localhost blueriq.dcm.rabbitmq.tenants.google.port=5672 blueriq.dcm.rabbitmq.tenants.google.username=google blueriq.dcm.rabbitmq.tenants.google.password=welcome blueriq.dcm.rabbitmq.tenants.google.exchangeName=processEvents blueriq.dcm.rabbitmq.tenants.google.virtualHost=google blueriq.dcm.rabbitmq.tenants.apple.host=localhost blueriq.dcm.rabbitmq.tenants.apple.port=5672 blueriq.dcm.rabbitmq.tenants.apple.username=apple blueriq.dcm.rabbitmq.tenants.apple.password=welcome blueriq.dcm.rabbitmq.tenants.apple.exchangeName=processEvents blueriq.dcm.rabbitmq.tenants.apple.virtualHost=apple
blueriq.case.engine.rabbitmq.tenants.google.host=localhost blueriq.case.engine.rabbitmq.tenants.google.port=5672 blueriq.case.engine.rabbitmq.tenants.google.username=google blueriq.case.engine.rabbitmq.tenants.google.password=welcome blueriq.case.engine.rabbitmq.tenants.google.virtualHost=google blueriq.case.engine.rabbitmq.tenants.google.queueNames=dcmListsService blueriq.case.engine.rabbitmq.tenants.apple.host=localhost blueriq.case.engine.rabbitmq.tenants.apple.port=5672 blueriq.case.engine.rabbitmq.tenants.apple.username=apple blueriq.case.engine.rabbitmq.tenants.apple.password=welcome blueriq.case.engine.rabbitmq.tenants.apple.virtualHost=apple blueriq.case.engine.rabbitmq.tenants.apple.queueNames=dcmListsService
Overriding the tenant filter
In the case that it is not possible to send the tenant name via a HTTP header, you are able to implement a custom tenant filter as shown in the example below. You can register your custom tenant filter as a Spring @Component
. The Runtime will search for a bean which implements the ITenantFilter
and if it is not available, it will fall back to the default tenant filter.
@Component public class MyCustomTenantFilter implements ITenantFilter { @Autowired private MultiTentancyProperties multiTentancyProperties; @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (multiTentancyProperties.isEnabled()) { String tenantName = null; // Retrieve tenantName ... setTenantName(tenantName); } chain.doFilter(request, response); } }