Skip to content

Improve auto reconnect for context/tenant detection #98

@schananas

Description

@schananas

If a service is already running before Axon Server is started, the context is not propagated to the service until that service is restarted.
In other words, when a user of this extension connects during the "reconnect" phase and then a new context is created, the service is required to be restarted.

Steps to reproduce and problem

The following message from a user of the extension makes the predicament clear:

Hi,
We encounter a strange behaviour with the services and contexts: It looks like, that if a service is already running before the axon server is started, so the connection happens during "reconnect", and then a new context is created, the context is not propagated to the service, until that service is restarted again.
Is this Problem already known? is there a configuration option etc, that solves this?
(We are using the tenants for multi tenancy => new contexts will dynamically be created, and therefore it is important, that all services notice this new context.

For the context registration/detection we are using:

public TenantConnectPredicate tenantFilterPredicate() {
    return context -> context.tenantId().startsWith("organization-");
}

Expected behaviour

The Multitenancy Extension should be resilient and reconnect if context updates break the channel's connection.

Actual behaviour

The Multitenancy extension may lose the connection from the context updates channel.
Since it is unable to reconnect, future updates never occur.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions