You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/13 10:35:04 UTC

[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3541: [ISSUE #3484] Fix sofa and websocket client lossless registration.

dragon-zhang commented on code in PR #3541:
URL: https://github.com/apache/incubator-shenyu/pull/3541#discussion_r895571069


##########
shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceEventListener.java:
##########
@@ -90,11 +92,11 @@ public SofaServiceBeanPostProcessor(final PropertiesConfig clientConfig, final S
     }
 
     @Override
-    public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
-        if (bean instanceof ServiceFactoryBean) {
-            executorService.execute(() -> handler((ServiceFactoryBean) bean));
+    public void onApplicationEvent(final ContextRefreshedEvent contextRefreshedEvent) {
+        Map<String, ServiceFactoryBean> serviceBean = contextRefreshedEvent.getApplicationContext().getBeansOfType(ServiceFactoryBean.class);
+        for (Map.Entry<String, ServiceFactoryBean> entry : serviceBean.entrySet()) {
+            executorService.execute(() -> handler(entry.getValue()));

Review Comment:
   please remove `executorService`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org