Audit Event store tenant configurationSince Audit Consumer 4.2 the audit consumer supports a multi-tenant datastore. Enabling multi-tenancy means that properties for listening to audit events messages and storing these audit event messages to a database can be configured for each tenant. For the audit event store only the properties url, username, password and JNDI are multi-tenant. JNDI is only required when a JNDI setup is used. Below are examples of how to configure a multi-tenant setup for the audit consumer. Tenant configuration Code Block |
---|
language | yml |
---|
title | Configuration YAML |
---|
| # Audit event store
blueriq:
audit:
consumer:
datasource:
audit-sql-store:
driver-class-name: <driver-class>
validation-query: <validation-query>
testWhileIdle: true
timeBetweenEvictionRunsMillis: 5000
tenants:
Apple:
url: <url>
username: <username>
password: <password>
Google:
url: <url>
username: <username>
password: <password>
# RabbitMQ
blueriq:
audit:
consumer:
rabbitmq:
tenants:
Apple
host: ---
port: ---
virtualHost: ---
username: ---
password: ---
ssl:
enabled: ---
queueNames: ---
errorExchange: ---
Google:
host: ---
port: ---
virtualHost: ---
username: ---
password: ---
ssl:
enabled: ---
queueNames: ---
errorExchange: --- |
JNDIIf you would like to use JNDI to configure your datasource, replace the blueriq.audit.consumer.datasource section in the application.yml described above with the following: Code Block |
---|
language | text |
---|
title | datasource |
---|
| blueriq:
audit:
consumer:
datasource:
audit-sql-store:
tenants:
Apple:
jndi-name: java:jboss/datasources/Apple
Google:
jndi-name: java:jboss/datasources/Google |
Be aware that if one tenant uses JNDI, all tenants should use JNDI. |