spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Introducing Sorting when binding yaml properties to OperationMethod in `findOperation`

Open jivebreaddev opened this issue 1 year ago • 1 comments

0. Summary: After the introduction of @Configurable to Retry and CircuitBreakerFilterSupplier, Yaml bindings start to fail. Debugging statements made for yaml bindings without @Configurable were not visibile as @Configurable bypass most of existing logic for Exceptions and Debugging statements. (https://github.com/spring-cloud/spring-cloud-gateway/issues/3172 )

Description

  1. In a raised issue(#3327), given yaml file to configure CircuitBreakerConfig seems to fail and produce an error below: image
  • given a Configuration Bean, the properties were bound successfully and CircuitBreaker was created successfully. image

  • in a situation where yaml file was passed on, CircuitBreaker failed to create. image

We can safely assume that creating circuitBreaker fails when using yaml file

Context and Background

  1. findOperation will iterate all possible Configuration Injection Methods to the matching properties provided by yaml file. LoggingOperationMismatch

  2. In this situation, String ID value was bound to wrong Injection Method(that requires CircuitConfig) thereby failing to create a CircuitBreaker instance.

image

a. given yaml file value: name:customerCircuitBreaker b. matched property value: CircuitBreaker(CircuitConfig)

image

  • this is result of the above code where @Configurable operation method always return despite yaml property value.

By processing Configurable method for the last, CircuitBreaker(String id) that should have been matched will have priorities over CircuitBreaker(CircuitConfig).

Resolves #3327

jivebreaddev avatar May 16 '24 13:05 jivebreaddev

@spencergibb any updates on PR?? I am really looking forward contributing to the project. Please let me know your thoughts!

jivebreaddev avatar May 25 '24 06:05 jivebreaddev