Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Sorting when binding yaml properties to OperationMethod in findOperation #3397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jivebreaddev
Copy link

@jivebreaddev jivebreaddev commented May 16, 2024

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. (#3172 )

Description

  1. In a raised issue(Adding circuitBreaker filter in mvc throws IllegalArgumentException #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

Given yaml Properties, CircuitBreaker(`CircuitConfig`) method passes binding test even when given value is `ID` not `CircuitConfig`

- operation method that is annotated with @configuration always pass binding test [findOperation] thereby creating wrong binding from property to method

Introducing Sorting to the operations, it will resolve methods without @configuration to be processed first and @configuration will be matched the last.

spring-cloud#3327
@jivebreaddev
Copy link
Author

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

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.

Adding circuitBreaker filter in mvc throws IllegalArgumentException
4 participants