APISIX 2.13.1 docker模式下开发java ext plugin

APISIX 2.13.1 docker模式下开发java ext plugin,第1张

记录下以docker-compose模式运行apisix,java ext plugin 开发

socket 目录问题

不能使用/tmp/runner.sock ,/tmp 在docker 内会被map为一个目录,换一个普通目录就可以,正常map后在docker ls

root@0715b8853748:/usr/local/apisix# ls -ltr /socket
total 0
srwxr-xr-x 1 root root 0 May  1 10:10 runner.sock

第一位是s,如果使用/tmp,第一位是d。

ext-plugin 位置

ext-plugin 是与apisix平级的,完整config如下

apisix:
  node_listen: 9080              # APISIX listening port
  enable_ipv6: false

  allow_admin:                  # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
    - 0.0.0.0/0              # We need to restrict ip access rules for security. 0.0.0.0/0 is for test.

  admin_key:
    - name: "admin"
      key: edd1c9f034335f136f87ad84b625c8f1
      role: admin                 # admin: manage all configuration data
                                  # viewer: only can view configuration data
    - name: "viewer"
      key: 4054f7cf07e344346cd3f287985e76a2
      role: viewer
  enable_control: true
  control:
    ip: "0.0.0.0"
    port: 9092

ext-plugin:
  path_for_test: /socket/runner.sock  

plugins:                          # plugin list (sorted by priority)
  - real-ip                        # priority: 23000
  - client-control                 # priority: 22000
Eclipse 下@RequiredArgsConstructor问题

Eclipse 下不能很好支持annotation RequiredArgsConstructor,运行会报构造函数不存在,改为自建构造函数即可。

 public HTTPReqCallHandler(Cache<Long, A6Conf> cache) {
		super();
		this.cache = cache;
	}
	
public PrepareConfHandler(Cache<Long, A6Conf> cache, Map<String, PluginFilter> filters) {
		super();
		this.cache = cache;
		this.filters = filters;
	}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/795366.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-06
下一篇 2022-05-06

发表评论

登录后才能评论

评论列表(0条)

保存