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

Optimize the Appactive module #3107

Merged
merged 24 commits into from
Feb 7, 2023
Merged

Optimize the Appactive module #3107

merged 24 commits into from
Feb 7, 2023

Conversation

yuluo-yx
Copy link
Collaborator

@yuluo-yx yuluo-yx commented Jan 18, 2023

  1. Add webClient interceptor
  2. Optimize ribbon and feigninterceptor names
  3. Delete the .gitignore file in the module
  4. Change the constant class name to AppactiveConstants, define static constants instead of strings
  5. Add 'OnMissingBean' annotation
  6. Change the name of ServiceMeta in common to ServiceMetaEntity to distinguish the ServerMeta interface in consumer
  7. Modify NacosAutoConfig in provider to ProviderAutoConfig
  8. Optimized ribbon interceptor injection

@yuluo-yx yuluo-yx changed the title update appactive module according to the Appactive优化建议.docx Optimize the Appactive module Jan 19, 2023
/**
* @author yuluo
*/
public class WebClientInterceptor extends HandlerInterceptorAdapter {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the interceptor interface of WebClient ExchangeFilterFunction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I understood it into a web request, give me a little time and I finish it.

@@ -90,6 +90,10 @@
<artifactId>fastjson</artifactId>
<version>2.0.11</version>
</dependency>
<dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add WebClient dependency? Is it spring-boot-starter-webflux?

/**
*@author: yuluo
*/
public class RestTemplateStrategyBeanPostProcessor implements BeanPostProcessor {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to reload the class? Please check how we initialize the FeignDecoderPostProcessor.

/**
* @author yuluo
*/
public class ReactiveRequestStrategyBeanPostProcessor implements BeanPostProcessor {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to reload the class? Please check how we initialize the FeignDecoderPostProcessor. BTW, if you can add relevant web client example, it be better. Otherwise, it's hard to check whether the logic is alright.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to reload the class? Please check how we initialize the FeignDecoderPostProcessor. BTW, if you can add relevant web client example, it be better. Otherwise, it's hard to check whether the logic is alright.

For WebClient-example, Please See #3140

}

@Bean
@ConditionalOnMissingBean(name = "reactiveRequestStrategyBeanPostProcessor ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a blank in the string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a blank in the string.

I removed the spaces in the code, please check again, thanks!

@@ -67,4 +67,16 @@ public RequestInterceptor feignRouterIdTransmissionRequestInterceptor() {
return new FeignRouterIdTransmissionRequestInterceptor();
}

@Bean
@ConditionalOnMissingBean(name = "restTemplateStrategyBeanPostProcessor ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a blank in the string.

Copy link
Collaborator

@steverao steverao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @yuluo-yx

@steverao steverao merged commit a2d91e5 into alibaba:2.2.x Feb 7, 2023
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