You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
This functionality is only available with the Multi Tenancy License. Please contact Blueriq Support.
Enabling Multi tenancy
blueriq.multi-tenancy.enabled=true blueriq.multi-tenancy.allowed-tenants=google,apple
These properties are used in each component that is mentiond on this page.
X-Tenant-ID
X-TENANT-ID
header containing the name of the desired tenant. If this header is missing or the tenant name is not on the allowed list, a message will be logged indicating that the tenant could not be identified, and an HTTP status 400 (Bad Request) will be returned.It is possible to change the name of the header using the following property
blueriq.multi-tenancy.http-header=http-tenant-id
This property can be used in each component that is mentiond on this page.
We advise to set up an HTTP server (for example NGINX or Apache HTTPD) which can be configured to add this HTTP header depending on, for instance, the url from which the Runtime is called.
AMQP Tenant Id
blueriq.multi-tenancy.amqp-header=amqp-tenant-id
We only support multi-tenancy where each tenant uses the same database vendor per component. You are not able to mix, for example, an Oracle tenant with an Microsoft SQL Server tenant.
Property Configuration
To enable multi-tenancy, it is essential to modify existing properties and add new ones for each tenant across all JDBC, JNDI, RabbitMQ, and MongoDB connections.
The primary adjustment involves inserting tenants.<tenantName>
between the property prefix and the actual property value. An example of this structure is provided below.
# RabbitMQ Host property for the Trace Event Publisher # Single Tenant blueriq.trace.event.publisher.channel.amqp.rabbitmq.host=localhost # Multi Tenant Google blueriq.trace.event.publisher.channel.amqp.rabbitmq.tenants.google.host=localhost # Multi Tenant Apple blueriq.trace.event.publisher.channel.amqp.rabbitmq.tenants.apple.host=apple.com
Default configuration
Default Multi-tenant RabbitMQ, Datasource & Mongodb properties
A default properties mechanism was added with Blueriq 16.74 because it can be tedious to configure all components of the Runtime with the same properties.
The following example shows default rabbitmq properties in a multi-tenant setup. There you can see how you can configure rabbitmq properties per tenant which will then be used for each component that uses rabbitmq instead of specifying it per component.
Because queue and exchange names are specific per component you still need to configure them as stated above.
This configuration will be used for each component that has no specific properties configured (except the queue and/or exchange names).
When neither specific nor default properties are configured for a tenant, the component will try to use the default rabbitmq properties for this tenant.
blueriq.default.rabbitmq.tenants.google.host=localhost blueriq.default.rabbitmq.tenants.google.port=5672 blueriq.default.rabbitmq.tenants.google.username=google blueriq.default.rabbitmq.tenants.google.password=welcome blueriq.default.rabbitmq.tenants.google.virtualHost=google blueriq.default.rabbitmq.tenants.google.ssl.enabled=true blueriq.default.mongodb.tenants.google.host=localhost blueriq.default.mongodb.tenants.google.port=27017 blueriq.default.mongodb.tenants.google.username=google blueriq.default.mongodb.tenants.google.password=welcome blueriq.default.datasource.tenants.google.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.default.datasource.tenants.google.username=google blueriq.default.datasource.tenants.google.password=welcome blueriq.default.rabbitmq.tenants.apple.host=localhost blueriq.default.rabbitmq.tenants.apple.port=5672 blueriq.default.rabbitmq.tenants.apple.username=apple blueriq.default.rabbitmq.tenants.apple.password=welcome blueriq.default.rabbitmq.tenants.apple.virtualHost=DefaultEverest blueriq.default.rabbitmq.tenants.apple.ssl.enabled=true blueriq.default.mongodb.tenants.apple.host=localhost blueriq.default.mongodb.tenants.apple.port=27017 blueriq.default.mongodb.tenants.apple.username=apple blueriq.default.mongodb.tenants.apple.password=welcome blueriq.default.datasource.tenants.apple.url=jdbc:oracle:thin:@localhost:1521:orcl blueriq.default.datasource.tenants.apple.username=apple blueriq.default.datasource.tenants.apple.password=welcome
Parameters can be configured at three levels for RabbitMQ or SQL-Datasources and MongoDB:
- default properties
blueriq.default.rabbitmq.*
blueriq.default.datasource.*
blueriq.default.mongodb.*
- default tenant-specific properties for all sources for that tenant:
blueriq.default.rabbitmq.tenants.<tenant_name>.*
blueriq.default.datasource.tenants.<tenant_name>.*
blueriq.default.mongodb.tenants.<tenant_name>.*
- tenant and component specific properties
blueriq.<component>.<path>.rabbitmq.tenants.<tenant_name>.*
blueriq.datasource.<component>.tenants.<tenant_name>.*
blueriq.<component>.mongodb.tenants.<tenant_name>.*
The properties supersede each other from general to more specific. So any properties from the most general level (default properties) will be overwritten by the other more specific levels. Example configuration:
# Generic level, all sources share the same host and port blueriq.default.rabbitmq.host=localhost blueriq.default.rabbitmq.port=5672 blueriq.default.rabbitmq.ssl.enabled=true # a different user and virtual host is used for each tenant (for all queue connections at this tenant) blueriq.default.rabbitmq.tenants.google.username=google blueriq.default.rabbitmq.tenants.google.password=welcome blueriq.default.rabbitmq.tenants.google.virtualHost=google blueriq.default.rabbitmq.tenants.apple.username=apple blueriq.default.rabbitmq.tenants.apple.password=welcome blueriq.default.rabbitmq.tenants.apple.virtualHost=apple # different components use different queues, which is most the specific level blueriq.trace.event.publisher.channel.amqp.rabbitmq.tenants.google.exchangeName=traceEvents blueriq.trace.event.publisher.channel.amqp.rabbitmq.tenants.apple.exchangeName=traceEvents # for one specific connection, all settings are overwritten blueriq.audit.rabbitmq.tenants.google.host=host_x blueriq.audit.rabbitmq.tenants.google.port=8080 blueriq.audit.rabbitmq.tenants.google.username=google blueriq.audit.rabbitmq.tenants.google.password=welcome blueriq.audit.rabbitmq.tenants.google.virtualHost=google blueriq.audit.rabbitmq.tenants.google.exchangeName=auditEvents # blueriq.audit.rabbitmq.tenants.google.exchangeName=auditEvents --> no need to specify exchange name because it's taken from blueriq.audit.rabbitmq.exchangeName blueriq.audit.rabbitmq.tenants.google.host=host_x blueriq.audit.rabbitmq.tenants.google.port=8080 blueriq.audit.rabbitmq.tenants.google.username=google blueriq.audit.rabbitmq.tenants.google.password=welcome blueriq.audit.rabbitmq.tenants.google.virtualHost=google blueriq.audit.rabbitmq.tenants.google.virtualHost=google blueriq.audit.rabbitmq.tenants.google.exchangeName=googleAuditEvents
This works for all components that use Datasource,RabbitMQ or MongoDB configuration