You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

Audit Event store tenant configuration

Since 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

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: --- 

JNDI

If 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:

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.