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/17 15:00:05 UTC

[GitHub] [incubator-shenyu] Albertsirius opened a new pull request, #3576: [ISSUE #3523]Add AOP for shenyu-examples-websocket.

Albertsirius opened a new pull request, #3576:
URL: https://github.com/apache/incubator-shenyu/pull/3576

   <!-- Describe your PR here; eg. Fixes #issueNo -->
   #3523 Add AOP for shenyu-examples-websocket
   <!--
   Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your changes.
   - [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
   


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


[GitHub] [incubator-shenyu] dragon-zhang merged pull request #3576: [ISSUE #3523]Add AOP for shenyu-examples-websocket.

Posted by GitBox <gi...@apache.org>.
dragon-zhang merged PR #3576:
URL: https://github.com/apache/incubator-shenyu/pull/3576


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


[GitHub] [incubator-shenyu] li-keguo commented on pull request #3576: [ISSUE #3523]Add AOP for shenyu-examples-websocket.

Posted by GitBox <gi...@apache.org>.
li-keguo commented on PR #3576:
URL: https://github.com/apache/incubator-shenyu/pull/3576#issuecomment-1158980315

   hi ~ I have some suggestion:
   The logging code looks similar,
   You can provide a separate module, e.g. xxxx-log-starter.
   add some code.
   
   ```java
   
   public @interface Log {
   }
   @Aspect
   @Component
   public class LogInterceptor {
   
       private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
   
       @Pointcut("@annotation(org.apache.shenyu.examples.websocket.aop.Log)")
       public void logPointcut() {
           //just for pointcut
       }
   
       @Around("logPointcut()")
       public Object around(ProceedingJoinPoint point) throws Throwable {
           try {
               log.info("before proceed");
               return point.proceed(point.getArgs());
           } finally {
               log.info("after proceed");
           }
       }
   }
   
   ```
   
   Then import it in the example,You can use the @Log annotation directly, and it can also be used in other places where it is needed, such as admin.
   
   ```xml
           <dependency>
               <groupId>org.apache.shenyu.boot</groupId>
               <artifactId>xxxx-log-starter</artifactId>
           </dependency>
   ```
   
   Of course, the parameters of the @log annotation can be enriched


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


[GitHub] [incubator-shenyu] dragon-zhang commented on pull request #3576: [ISSUE #3523]Add AOP for shenyu-examples-websocket.

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on PR #3576:
URL: https://github.com/apache/incubator-shenyu/pull/3576#issuecomment-1159111367

   @li-keguo never mind, these code will be refactored later.


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