Versions Compared

Key

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

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

Code Block
languageyml
titleConfiguration 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:

Code Block
languagetext
titledatasource
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.