We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why write confToken twice when writing back to API SIX
jdk11
protected void channelRead0(ChannelHandlerContext ctx, A6Request request) { if (request.getType() != Constants.RPC_PREPARE_CONF) { ctx.fireChannelRead(request); return; } Req req = ((A6ConfigRequest) request).getReq(); long confToken = ThreadLocalRandom.current().nextInt(Integer.MAX_VALUE); A6Response response = new A6ConfigResponse(confToken); long token = ((A6ConfigResponse) response).getConfToken(); PluginFilterChain chain = createFilterChain(req); /* * to reset vtable_start and vtable_size of req, * so that req can be reused after being got from the cache. * {@link org.apache.apisix.plugin.runner.handler.A6HttpCallHandler#handle cache.getIfPresent()} * @see <a href="Issues63"> https://github.com/apache/apisix-java-plugin-runner/issues/63</a> * */ Map<String, String> config = new HashMap<>(); for (int i = 0; i < req.confLength(); i++) { TextEntry conf = req.conf(i); config.put(conf.name(), conf.value()); } A6Conf a6Conf = new A6Conf(config, chain); cache.put(token, a6Conf); for (A6ConfigWatcher watcher : watchers) { watcher.watch(token, a6Conf); } ctx.write(response); ctx.writeAndFlush(response); }
The text was updated successfully, but these errors were encountered:
FYI I opened #321 that merges the token and confToken variables in the code extract pasted above.
token
confToken
Is that what was meant?
Sorry, something went wrong.
No branches or pull requests
Issue description
Why write confToken twice when writing back to API SIX
Environment
jdk11
0.5
Minimal test code / Steps to reproduce the issue
What's the actual result? (including assertion message & call stack if applicable)
What's the expected result?
The text was updated successfully, but these errors were encountered: