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 16:10:45 UTC

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

lahmXu commented on code in PR #3541:
URL: https://github.com/apache/incubator-shenyu/pull/3541#discussion_r895900178


##########
shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java:
##########
@@ -93,9 +93,14 @@ public SpringWebSocketClientBeanPostProcessor(final PropertiesConfig clientConfi
     }
 
     @Override
-    public Object postProcessAfterInitialization(@NonNull final Object bean,
-        @NonNull final String beanName) throws BeansException {
+    public void onApplicationEvent(final ContextRefreshedEvent contextRefreshedEvent) {
+        String[] beanNames = contextRefreshedEvent.getApplicationContext().getBeanDefinitionNames();

Review Comment:
   After testing I found a problem with this. It will not get the bean when @ShenyuSpringWebSocketClient marked on the method. 
   like this:
   
   ```
   @Component
   public class Config {
       @ShenyuSpringWebSocketClient(path = "/org/apache/shenyu/examples/websocket/**", desc = "onlineusers")
       public void handle() {
           return;
       }
   }
   ```



-- 
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