Skip to content

io microsphere i18n spring cloud event ReloadableResourceServiceMessageSourceListener

github-actions[bot] edited this page Jul 9, 2026 · 12 revisions

ReloadableResourceServiceMessageSourceListener

Type: Class | Module: microsphere-i18n-spring-cloud | Package: io.microsphere.i18n.spring.cloud.event | Since: 1.0.0

Source: microsphere-i18n-spring-cloud/src/main/java/io/microsphere/i18n/spring/cloud/event/ReloadableResourceServiceMessageSourceListener.java

Overview

An ApplicationListener of EnvironmentChangeEvent to reload ServiceMessageSource dynamically at runtime when Spring Cloud environment properties change.

Example Usage

`// Automatically imported via I18nCloudAutoConfiguration
  // When an EnvironmentChangeEvent is fired (e.g. via /actuator/refresh),
  // this listener reloads all PropertySourcesServiceMessageSource beans
  // whose property names match the changed keys.
`

Declaration

public class ReloadableResourceServiceMessageSourceListener implements ApplicationListener<EnvironmentChangeEvent>,

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.17-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

// Automatically imported via I18nCloudAutoConfiguration
  // When an EnvironmentChangeEvent is fired (e.g. via /actuator/refresh),
  // this listener reloads all PropertySourcesServiceMessageSource beans
  // whose property names match the changed keys.

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-i18n-spring-cloud</artifactId>
    <version>${microsphere-i18n.version}</version>
</dependency>

Tip: Use the BOM (microsphere-i18n-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.i18n.spring.cloud.event.ReloadableResourceServiceMessageSourceListener;

API Reference

Public Methods

Method Description
onApplicationEvent
setBeanFactory

See Also

  • PropertySourcesServiceMessageSource
  • DelegatingServiceMessageSource
  • ReloadableResourceServiceMessageSource
  • ServiceMessageSource
  • EnvironmentChangeEvent

This documentation was auto-generated from the source code of microsphere-i18n.

Clone this wiki locally