| /** | 
|  * projectName: zq-erp | 
|  * fileName: TestMessageHander.java | 
|  * packageName: com.matrix.component.asyncmessage | 
|  * date: 2021-10-18 16:05 | 
|  * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. | 
|  */ | 
| package com.matrix.component.asyncmessage; | 
|   | 
| import com.matrix.core.tools.LogUtil; | 
| import org.springframework.scheduling.annotation.Async; | 
| import org.springframework.stereotype.Component; | 
|   | 
| import java.util.Map; | 
|   | 
| /** | 
|  * @version: V1.0 | 
|  * @author: JiangYouYao | 
|  * @className: TestMessageHander | 
|  * @packageName: com.matrix.component.asyncmessage | 
|  * @description: 测试观察者 | 
|  * @data: 2021-10-18 16:05 | 
|  **/ | 
| @Component | 
| public class TestMessageHander implements  MessageHandler{ | 
|   | 
|     @Override | 
|     public String getName() { | 
|         return "测试观察者"; | 
|     } | 
|   | 
|     @Override | 
|     public String getRouteKey() { | 
|         return "testkey"; | 
|     } | 
|   | 
|     @Override | 
|     public void handle(Map<String, Object> param) { | 
|         try { | 
|             Thread.sleep(1000*5); | 
|         } catch (InterruptedException e) { | 
|             e.printStackTrace(); | 
|         } | 
|         LogUtil.debug(param.toString()); | 
|     } | 
| } |