Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

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.

Code Block
languagetext
titleapplication.properties
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:

  1. default properties
    blueriq.default.rabbitmq.*
    blueriq.default.datasource.*
    blueriq.default.mongodb.*
  2. 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>.*
  3. 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:

Code Block
languagetext
titleapplication.properties
# 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=
auditEvents
googleAuditEvents