Giter Site home page Giter Site logo

luoliangdsga / spring-learning Goto Github PK

View Code? Open in Web Editor NEW
524.0 39.0 383.0 9.39 MB

:fire::fire::tada:Spring Learning Project, Enjoy it

Java 75.90% JavaScript 9.94% HTML 1.24% Vue 12.62% CSS 0.07% Dockerfile 0.23%
spring-boot elastic-job dubbo vue-springboot

spring-learning's Issues

作者 你好

post文件上传时并没有上传文件 file字段都没 这个是需要这么处理呢

在您的boot-dubbo项目中,dubbo-consumer无法找到dubbo-provider:jar的jar包

我在dubbo-provider项目下执行了打包命令,然后springboot:run了dubbo-provider项目,在springboot:run项目dubbo-consumer时报错
[ERROR] Failed to execute goal on project dubbo-consumer: Could not resolve dependencies for project org.boot.dubbo:dubbo-consumer:jar:1.0.0-SNAPSHOT: Could not find artifact org.boot.dubbo:dubbo-provider:jar:1.0.0-SNAPSHOT -> [Help 1]

Docker基础镜像

留意到boot-dubbo项目中使用了Dockerfile,而其中的基础镜像为java8。推荐基础镜像需要java环境时最好使用openJDK,如openjdk:8-jdk-alpine,因为oracle可能会“不喜欢”

使用时遇到点问题

1。
现在用的是Antdv的Admin的模板,引入 你的插件并Use之后。
在页面中的表单里使用。
提示错误:
this.xhr.upload.addEventListener is not a function

所以是不是你有些方法的this没有强得绑定到你插件里面的对象,导致单独作为表单中的组件 中使用时,this上下文指向出问题。
2,然后建议演示实例用原生的一些控件或者Vue的antd或者eleme的组件 演示也行,用Slot覆盖的话,能让使用模板的同学现方便用自己的样式插入你的组件 中。

boot-uploader上传含中文路径文件夹uniqueIdentifier有问题;文件名含'-'merge时bug.

        Files.list(Paths.get(folder))
                .filter(path -> !path.equals(Paths.get(targetFile)))
                .filter(path -> path.getFileName().toString().contains("-"))
                .sorted((o1, o2) -> {
                    String p1 = o1.getFileName().toString();
                    String p2 = o2.getFileName().toString();
                    int i1 = p1.lastIndexOf("-");
                    int i2 = p2.lastIndexOf("-");
                    return Integer.valueOf(p2.substring(i2)).compareTo(Integer.valueOf(p1.substring(i1)));
                })
                .forEach(path -> {
                    try {
                        //以追加的形式写入文件
                        Files.write(Paths.get(targetFile), Files.readAllBytes(path), StandardOpenOption.APPEND);
                        //合并后删除该块
                        Files.delete(path);
                    } catch (IOException e) {
                        logger.error(e.getMessage(), e);
                    }
                });

Elastic-job 分片项处理问题

Which version of Elastic-Job do you using?(您使用的Elastic-Job版本为?)

版本为2.1.5

调用一个创建作业接口,会将分片项分配到活着的job节点中处理。

得分别调用两个节点的创建作业接口才会将任务项分配到两个节点中处理。若只调用一个节点, 他会将所有的分片项在这个节点上处理。

分别启动两个节点, 先调用一台节点上的创建作业接口, 所有的分片项都会在此节点上处理,再次调用另一节点创建作业接口, 此时,分片项会在俩个节点上处理。

@Autowired
    private SimpleJob simpleJob;

    @Autowired
    private ZookeeperRegistryCenter regCenter;

    @Autowired
    private JobEventConfiguration jobEventConfiguration;

    @Value("${simpleJob.cron}")
    private String con;

    @Value("${simpleJob.shardingTotalCount}")
    private int shardingTotalCount;

    @Value("${simpleJob.shardingItemParameters}")
    private String shardingItemParameters;

    /**---------------------------------------------启动作业 START-------------------------------------------*/
    /**
     * 启动作业
     * @return
     */
    @GetMapping("/startTask")
    public String startTask() {

        new SpringJobScheduler(simpleJob, regCenter, getLiteJobConfiguration(simpleJob.getClass(), con,
                shardingTotalCount, shardingItemParameters), jobEventConfiguration, new MyElasticJobListener()).init();
        return "success";
    }

    private LiteJobConfiguration getLiteJobConfiguration(final Class<? extends SimpleJob> jobClass, final String cron,
                                                         final int shardingTotalCount, final String shardingItemParameters) {
        return LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(JobCoreConfiguration.newBuilder(
                jobClass.getName(), cron, shardingTotalCount).shardingItemParameters(shardingItemParameters).build(),
                jobClass.getCanonicalName())).overwrite(true).build();
    }
# 注册中心在Spring容器中的主键
regCenter:
  # 连接Zookeeper服务器的列表, 包括IP地址和端口号,多个地址用逗号分隔。如: host1:2181,host2:2181
  serverList: 10.4.66.99:6181,10.4.66.95:6181
  # Zookeeper的命名空间
  namespace: elastic-job-lite-springboot
  
simpleJob:
  cron: 0/5 * * * * ?
  shardingTotalCount: 2
  shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.