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
@Configuration public class IdAutoConfig { @Value("${mybatis-plus.zookeeper.serverLists}") private String zkServerLists; @Bean public IdentifierGenerator idGenerator() { // 设置zk服务器地址 ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(); zookeeperConfiguration.setServerLists(zkServerLists); // 设置本地缓存和序列化方式 ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration(); applicationConfiguration.setCacheable(false); applicationConfiguration.setSerialize(SerializeStrategy.SERIALIZE_JSON_JACKSON); // 创建idworker实例 return new ImadcnIdentifierGenerator(zookeeperConfiguration, applicationConfiguration); } }
tmp/idworker/default.cache 每次项目启动运行之后还是会在项目目录里生成这个缓存文件,有什么方法能够不生成吗
The text was updated successfully, but these errors were encountered:
ZookeeperWorkerRegister
// 无本地信息或者缓存数据不匹配,开始向ZK申请节点机器ID for (int workerId = 0; workerId < MAX_WORKER_NUM; workerId++) { workerIdStr = String.valueOf(workerId); if (!children.contains(workerIdStr)) { // 申请成功 NodeInfo applyNodeInfo = createNodeInfo(getNodePath().getGroupName(), workerId); getNodePath().setWorkerId(applyNodeInfo.getWorkerId()); // 保存ZK节点信息,保存本地缓存,开启定时上报任务 saveZookeeperNodeInfo(getNodePath().getWorkerIdPath(), applyNodeInfo); saveLocalNodeInfo(applyNodeInfo); executeUploadNodeInfoTask(getNodePath().getWorkerIdPath(), applyNodeInfo); return applyNodeInfo.getWorkerId(); } }
saveLocalNodeInfo可以根据isCacheable去掉吗,本地每次运行完git总会多一个uncommitted的文件
Sorry, something went wrong.
No branches or pull requests
tmp/idworker/default.cache
每次项目启动运行之后还是会在项目目录里生成这个缓存文件,有什么方法能够不生成吗
The text was updated successfully, but these errors were encountered: