Skip to content

Remove binding properties of evicted channels sent with a binder name - #3306

Closed
kdelay wants to merge 1 commit into
spring-cloud:mainfrom
kdelay:fix/streambridge-evict-binding-name
Closed

kdelay wants to merge 1 commit into
spring-cloud:mainfrom
kdelay:fix/streambridge-evict-binding-name

Conversation

@kdelay

@kdelay kdelay commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

On eviction, StreamBridge removes the evicted binding's properties using the cache key. With a binder name that key is <binder>:<destination>, but BindingServiceProperties keys the entry by destination alone, so for send(destination, binderName, data) nothing is removed and one entry is kept per destination ever sent to.

This uses the channel's binding name for the removal and for the configured-binding check added in #3257.

Added bindingsWithBinderNameAreRemovedWithCache. Without the fix it fails with binding1 and binding2 still present. ./mvnw -f core/pom.xml install passes. In StreamBridgeTests only test_3033 fails, with or without this change.

When StreamBridge evicts a channel from its cache it removes the binding
properties that were created for the dynamic destination. It did so with
the cache key, which is "<binder>:<destination>" when a binder name is
given, while BindingServiceProperties keys the entry by the destination
alone. For StreamBridge.send(destination, binderName, data) the removal
was therefore a no-op and one BindingProperties entry was kept for every
destination ever sent to, regardless of dynamic-destination-cache-size.

Use the name the channel was created for when removing the properties
and when checking whether the binding was configured by the application.

Signed-off-by: kdelay <kdelay20@gmail.com>
@olegz olegz closed this in 64ab8ac Oct 14, 2026
olegz pushed a commit that referenced this pull request Oct 14, 2026
When StreamBridge evicts a channel from its cache it removes the binding
properties that were created for the dynamic destination. It did so with
the cache key, which is "<binder>:<destination>" when a binder name is
given, while BindingServiceProperties keys the entry by the destination
alone. For StreamBridge.send(destination, binderName, data) the removal
was therefore a no-op and one BindingProperties entry was kept for every
destination ever sent to, regardless of dynamic-destination-cache-size.

Use the name the channel was created for when removing the properties
and when checking whether the binding was configured by the application.

Signed-off-by: kdelay <kdelay20@gmail.com>
Resolves #3306
@olegz olegz added this to the 5.0.4 milestone Oct 14, 2026
@olegz olegz modified the milestones: 5.0.4, 5.1.0-RC1 Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants