Skip to content

Commit bff4bbd

Browse files
Merge pull request #301 from AxonIQ/feature/multi-context-configuration
Add information about how to configure Axon Framework for multi-context
2 parents e9113b8 + 3da891e commit bff4bbd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

axon-server/administration/multi-context.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ When you create a context, there are a number of default properties that you can
3535

3636
As of version 4.4, Axon Server has a new format for the index of events and snapshots, called JUMP\_SKIP\_INDEX. This is the default format for all contexts that are created from this version onwards. This index format uses a global index to locate the last event for a specific aggregate, and maintains per segment per aggregate the location of the previous event. It improves the efficiency in looking up aggregates that are distributed over segments that are further apart. For instance if you have 2000 event segments and an aggregate has events in segment 1500, 1000 and 500, using this index, Axon Server will find the latest event using the global index, and then from the index for segment 1500 that the previous event is in segment 1000. This prevents checking \(the indexes of\) all the files in between. When using this index, Axon Server will no longer create bloom filter files. For existing contexts the index format will remain BLOOM\_FILTER\_INDEX.
3737

38+
## Usage in Axon Framework
39+
40+
After a context has been setup in Axon Server EE, Axon Framework applications can connect to it by setting the `axon.axonserver.context` property when using Spring Boot, or setting the `defaultContext` on the builder of `AxonServerConnectionManager` that is passed to the event store.
41+
Note that depending on message source configuration, other contexts may be used besides the default.
42+
43+
### Sending to other contexts
44+
45+
All messages in that application will be sent and received only from the default context, unless specificied otherwise.
46+
In order to send commands and queries to a different context, you can provide a `TargetContextResolver` to the `Configurer`.
47+
This resolver will be used to determine the target context based on the message.
48+
49+
### Reading events from multiple contexts
50+
51+
You can stream events from multiple contexts in the same processor. This is described in the [Streaming Events Processors' Multiple event sources section](../../axon-framework/events/event-processors/streaming.md#multiple-event-sources).
52+
53+
### Multi-tenancy
54+
55+
When an application handles multiple tenants, it might make sense to create separate store per tenant.
56+
Handling multiple tenants needs additional infrastructure, such as duplication of the event processor for each tenant, as well as datasource configuration.
57+
For this we have created the Multi-Tenancy extension to Axon Framework], that takes care of this infrastructure for you.
58+
59+
3860
> **Pre-4.4 Context Deletion**
3961
>
4062
> Note that when you delete an existing context with the preserve data option and then recreate it, without specifying the index format, Axon Server will use the JUMP\_SKIP\_INDEX format. This means that it will create a new index for the existing data, if the old format was BLOOM\_FILTER\_INDEX. Depending on the size of the event store this can take a long time.

0 commit comments

Comments
 (0)