--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
there are different ways to implement multi-tenancy in Axon. If you use multitenancy on the datasource level, there are some restrictions, though. The TrackingProcessor, for example, doesn't support this (yet). The rest of the components should not have any issues.
spring.jpa.properties.hibernate.multiTenancy=SCHEMA
spring.jpa.properties.hibernate.tenant_identifier_resolver=br.com.zup.realwave.common.tenant.context.CurrentTenantIdentifier
spring.jpa.properties.hibernate.multi_tenant_connection_provider=br.com.zup.realwave.common.tenant.provider.PostgreSqlMultiTenantConnectionProvider
If you use Hibernate/JPA, you can override any configuration defined by annotations. I haven't used it myself, but apparantly there are ways (using XML, though) to override the definitions.Alternatively, you can extend the JpaEventStorageEngine and implement the domainEventEntryEntityName and createEventEntity methods. This allows you to use your own entities. Note that these entities must have the same properties defined as the original Axon entities. Some projects use this to add additional columns to the event store, or -just like what you'd want- change some of the properties that are generated by default.
spring.jpa.hibernate.ddl-auto=create
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="2.0">
<mapped-superclass class="org.axonframework.eventsourcing.eventstore.AbstractSequencedDomainEventEntry" access="FIELD">
<attributes>
<id name="globalIndex">
<column name="global_index"/>
<generated-value generator="generator" strategy="SEQUENCE"/>
<sequence-generator name="generator" sequence-name="domain_event_entry_seq" allocation-size="1"/>
</id>
</attributes>
</mapped-superclass>
</entity-mappings>