Skip to content

Only apply bus env changes when the event targets the app - #3302

Closed
kdelay wants to merge 1 commit into
spring-cloud:mainfrom
kdelay:fix/bus-env-change-destination
Closed

kdelay wants to merge 1 commit into
spring-cloud:mainfrom
kdelay:fix/bus-env-change-destination

Conversation

@kdelay

@kdelay kdelay commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

POST /actuator/busenv/{destination} changes the environment of the instance that received the request even when the destination is another service. The endpoint publishes the event locally, and EnvironmentChangeListener applies it without checking the destination.

RefreshListener and ShutdownListener already check ServiceMatcher#isForSelf for this (spring-cloud-bus#68, #221). This adds the same check to EnvironmentChangeListener.

The new EnvironmentChangeListenerIntegrationTests fails without the change (expected: null but was: "changed" for a demoapp destination on a foobar app). ./mvnw -pl bus/spring-cloud-bus verify passes, 77 tests.

EnvironmentChangeListener applied every EnvironmentChangeRemoteApplicationEvent
it saw. Events published by the busenv endpoint are also delivered to local
listeners, so POST /actuator/busenv/{destination} changed the environment of
the instance that received the request even when the destination was another
service.

RefreshListener and ShutdownListener already check ServiceMatcher#isForSelf
for the same reason (spring-cloud-bus#68). Do the same here.

Signed-off-by: kdelay <kdelay20@gmail.com>
@olegz olegz closed this in 5195cb9 Oct 9, 2026
@olegz olegz modified the milestones: 5.0.0-M2, 5.0.4, 5.1 Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants