资源简介

SpringBoot整合kafka代码,两个工程 一个消费者 一个生产者,利用定时任务。很简洁代码。欢迎大家下载哦。可参考这篇文章代码哦。https://blog.csdn.net/weixin_39984161/article/details/91986809

资源截图

代码片段和文件信息

/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License Version 2.0 (the
“License“); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing
software distributed under the License is distributed on an
“AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
*/

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;

public class MavenWrapperDownloader {

    /**
     * Default URL to download the maven-wrapper.jar from if no ‘downloadUrl‘ is provided.
     */
    private static final String DEFAULT_DOWNLOAD_URL =
            “https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar“;

    /**
     * Path to the maven-wrapper.properties file which might contain a downloadUrl property to
     * use instead of the default one.
     */
    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
            “.mvn/wrapper/maven-wrapper.properties“;

    /**
     * Path where the maven-wrapper.jar will be saved to.
     */
    private static final String MAVEN_WRAPPER_JAR_PATH =
            “.mvn/wrapper/maven-wrapper.jar“;

    /**
     * Name of the property which should be used to override the default download url for the wrapper.
     */
    private static final String PROPERTY_NAME_WRAPPER_URL = “wrapperUrl“;

    public static void main(String args[]) {
        System.out.println(“- Downloader started“);
        File baseDirectory = new File(args[0]);
        System.out.println(“- Using base directory: “ + baseDirectory.getAbsolutePath());

        // If the maven-wrapper.properties exists read it and check if it contains a custom
        // wrapperUrl parameter.
        File mavenWrapperPropertyFile = new File(baseDirectory MAVEN_WRAPPER_PROPERTIES_PATH);
        String url = DEFAULT_DOWNLOAD_URL;
        if (mavenWrapperPropertyFile.exists()) {
            FileInputStream mavenWrapperPropertyFileInputStream = null;
            try {
                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
                Properties mavenWrapperProperties = new Properties();
                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL url);
            } catch (IOException e) {
                Syst

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-06-14 16:30  consumer\
     文件         303  2019-06-14 16:25  consumer\.gitignore
     目录           0  2019-06-14 16:53  consumer\.idea\
     文件         628  2019-06-14 16:25  consumer\.idea\compiler.xml
     文件         172  2019-06-14 16:25  consumer\.idea\encodings.xml
     目录           0  2019-06-14 16:29  consumer\.idea\libraries\
     文件         599  2019-06-14 16:29  consumer\.idea\libraries\Maven__ch_qos_logback_logback_classic_1_1_11.xml
     文件         578  2019-06-14 16:29  consumer\.idea\libraries\Maven__ch_qos_logback_logback_core_1_1_11.xml
     文件         546  2019-06-14 16:29  consumer\.idea\libraries\Maven__com_fasterxml_classmate_1_3_4.xml
     文件         668  2019-06-14 16:29  consumer\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml
     文件         626  2019-06-14 16:29  consumer\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_core_2_8_10.xml
     文件         654  2019-06-14 16:29  consumer\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_databind_2_8_10.xml
     文件         570  2019-06-14 16:29  consumer\.idea\libraries\Maven__com_jayway_jsonpath_json_path_2_2_0.xml
     文件         724  2019-06-14 16:25  consumer\.idea\libraries\Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml
     文件         635  2019-06-14 16:29  consumer\.idea\libraries\Maven__javax_validation_validation_api_1_1_0_Final.xml
     文件         479  2019-06-14 16:25  consumer\.idea\libraries\Maven__junit_junit_4_12.xml
     文件         512  2019-06-14 16:29  consumer\.idea\libraries\Maven__net_jpountz_lz4_lz4_1_2_0.xml
     文件         566  2019-06-14 16:29  consumer\.idea\libraries\Maven__net_minidev_accessors_smart_1_1.xml
     文件         545  2019-06-14 16:29  consumer\.idea\libraries\Maven__net_minidev_json_smart_2_2_1.xml
     文件         600  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_apache_kafka_kafka_clients_0_9_0_1.xml
     文件         649  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_23.xml
     文件         635  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_23.xml
     文件         684  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_23.xml
     文件         660  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_apache_tomcat_tomcat_annotations_api_8_5_23.xml
     文件         559  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_assertj_assertj_core_2_6_0.xml
     文件         641  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_freemarker_freemarker_2_3_26_incubating.xml
     文件         556  2019-06-14 16:25  consumer\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xml
     文件         577  2019-06-14 16:25  consumer\.idea\libraries\Maven__org_hamcrest_hamcrest_library_1_3.xml
     文件         658  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_hibernate_hibernate_validator_5_3_5_Final.xml
     文件         632  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_jboss_logging_jboss_logging_3_3_1_Final.xml
     文件         573  2019-06-14 16:29  consumer\.idea\libraries\Maven__org_mockito_mockito_core_1_10_19.xml
............此处省略192个文件信息

评论

共有 条评论

相关资源