Skip to content

Allow overriding phase in RedisMessageListenerContainer #3208

@eye-dee

Description

@eye-dee

Title: Allow overriding phase in RedisMessageListenerContainer

Description:
Currently, RedisMessageListenerContainer uses the default SmartLifecycle phase of Integer.MAX_VALUE.
This makes it difficult to control startup/shutdown ordering relative to other SmartLifecycle beans in the application.

In some scenarios, developers may want to ensure that certain beans start after the Redis listener container is fully initialized, or conversely, that the container waits until other infrastructure is ready before starting. Since the phase is not configurable, fine-grained lifecycle control is not possible.

Proposal:
Introduce the ability to override the phase of RedisMessageListenerContainer, for example by:

  • Exposing a setPhase(int phase) method

Use case:

  • Ensuring custom initialization logic (that depends on the container being ready) runs after the container is started.
  • Aligning the container’s lifecycle with other messaging or connection beans that also implement SmartLifecycle.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions