浏览代码

青涩知夏->完善配置

青涩知夏 5 年之前
父节点
当前提交
54f75f9401

+ 1 - 1
src/main/java/cn/nosum/gateway/handler/SlotProcessHandler.java

@@ -16,7 +16,7 @@ public class SlotProcessHandler extends SimpleChannelInboundHandler<Context> {
 
     @Override
     protected void channelRead0(ChannelHandlerContext ctx, Context context) throws Exception {
-        // TODO 进行过滤链的执行,应该使用扩展点实现获取
+        // 构造过滤器链
         ProcessorSlot<Context> chain = SlotChainProvider.newSlotChain();
         try {
             chain.exec(context);

+ 1 - 1
src/main/java/cn/nosum/gateway/slot/ProcessorSlotChain.java

@@ -3,7 +3,7 @@ package cn.nosum.gateway.slot;
 import cn.nosum.common.annotation.SPI;
 import cn.nosum.common.http.entity.Context;
 
-@SPI
+@SPI("link")
 public interface ProcessorSlotChain extends ProcessorSlot<Context> {
 
     /**

+ 1 - 1
src/main/java/cn/nosum/gateway/slot/build/SlotChainBuilder.java

@@ -7,7 +7,7 @@ import cn.nosum.gateway.slot.ProcessorSlotChain;
 /**
  * 处理槽构建器顶层接口
  */
-@SPI("default")
+@SPI("context")
 public interface SlotChainBuilder {
 
     /**

+ 4 - 2
src/main/resources/application.properties

@@ -1,6 +1,8 @@
+# 容器端口号
 container.port = 8888
-container.context.handler.class.name[0]=cn.nosum.gateway.handler.PreProcessHandler
-container.context.handler.class.name[1]=cn.nosum.gateway.handler.FinalProcessHandler
+# 示例配置,即使不配置也是默认使用这些
 cn.nosum.common.extension.ExtensionFactory = adaptive
 cn.nosum.gateway.container.GateWayContainer = netty
 cn.nosum.gateway.handler.build.HandlerBuilder = context
+cn.nosum.gateway.slot.build.SlotChainBuilder = context
+cn.nosum.gateway.slot.LinkProcessorSlotChain = link