Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Baoyi Chen
    @leonchen83
    image.png
    Mahadevan-P
    @Mahadevan-P
    I am having jdk8 .in jdk home i want to copy my jdk8 path right??
    Baoyi Chen
    @leonchen83
    yes
    and install jdk11
    copy to jdkhome in bottom
    Mahadevan-P
    @Mahadevan-P
    ok in second jdk home i want to copy that jdk11 path right??
    Baoyi Chen
    @leonchen83
    yes

    here is my jdk8 path and jdk11 path

    <jdkHome>C:\Java\jdk1.8.0</jdkHome>
    <jdkHome>C:\Java\jdk-11</jdkHome>

    Mahadevan-P
    @Mahadevan-P
    ok thanks
    Mahadevan-P
    @Mahadevan-P
    I have set both the path .still the error in pom.xml files exist.whether i need to download anything with regards to toolchain."Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain (execution: toolchain, phase: validate)".how to clear this
    Baoyi Chen
    @leonchen83
    could you run mvn clean install -Dmaven.test.skip=true --global-toolchains ./toolchains.xml in command line?
    Mahadevan-P
    @Mahadevan-P
    where we want to run this command?? in git bash??
    Baoyi Chen
    @leonchen83
    yes, git bash is ok
    first check maven version by mvn -v
    and paste result to here
    Mahadevan-P
    @Mahadevan-P
    $ mvn -v
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: C:\Users\DELL\Downloads\apache-maven-3.6.3-bin\apache-maven-3.6.3
    Java version: 9.0.4, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jre-9.0.4
    Default locale: en_US, platform encoding: Cp1252
    OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
    Baoyi Chen
    @leonchen83
    run this in command to make sure code can compile successfully in command line
    ok, cd to redis-replicator code path and run mvn clean install -Dmaven.test.skip=true --global-toolchains ./toolchains.xml
    Mahadevan-P
    @Mahadevan-P
    after writing cd to redis-replicator command, i got this error
    bash: cd: ./redis-replicator:No such file or directory
    Baoyi Chen
    @leonchen83
    could you paste the redis-replicator code path here?
    for example C:\workspace\redis-replicator
    Mahadevan-P
    @Mahadevan-P
    where we want to paste this path
    Baoyi Chen
    @leonchen83
    in my PC , I should type cd /c/workspace/redis-replicator
    and then type mvn clean install -Dmaven.test.skip=true --global-toolchains ./toolchains.xml
    in your PC ,that path is different.
    Mahadevan-P
    @Mahadevan-P
    ok in environment variable i want to paste that could loaction right?
    Baoyi Chen
    @leonchen83
    no , not releate environment variable
    Mahadevan-P
    @Mahadevan-P
    i have copied the path just u tell where i want to paste that path
    Baoyi Chen
    @leonchen83
    image.png
    in my PC is above code path? what is yours?
    Baoyi Chen
    @leonchen83
    so in my git bash , I need type cd /c/workspace/redis-replicator
    Mahadevan-P
    @Mahadevan-P
    C:\Users\Maha\git\redis-replicator this is my path where i want to paste this
    Baoyi Chen
    @leonchen83
    so ,in your git bash try cd /c/Users/Maha/git/redis-replicator
    Mahadevan-P
    @Mahadevan-P
    $ C:\Users\Maha\git\redis-replicator
    bash: C:UsersMahagitredis-replicator: command not found
    Baoyi Chen
    @leonchen83
    cd /c/Users/Maha/git/redis-replicator not C:\Users\Maha\git\redis-replicator
    Mahadevan-P
    @Mahadevan-P
    its working
    still now u did not give any suggestion on that pom.xml file error. <execution>
    <id>toolchain</id>
    <goals>
    <goal>toolchain</goal> getting error in the execution statement
    Baoyi Chen
    @leonchen83
    its working in command line. so that is STS problem, maybe STS doesn't support maven toolchain
    Mahadevan-P
    @Mahadevan-P
    the project has been build successfull in cmd and i got a jar file(redis-replicator 3.5.4) jar is it possible to run another application with this jar file.if possible how to do it?
    Baoyi Chen
    @leonchen83
    usually we use maven dependency to dependent redis-replicator
    for example create a maven project , in that pom.xml add following dependency
            <dependency>
                <groupId>com.moilioncircle</groupId>
                <artifactId>redis-replicator</artifactId>
                <version>3.5.4</version>
            </dependency>
    you can refer to pom.xml int redis-rdb-cli
    redis-rdb-cli use redis-replicator as dependency
    Mahadevan-P
    @Mahadevan-P
    Our intention is to use your source code mainly to sync the data from redis to MySQL. So far I have successfully created a jar. But was wondering how does it help in syncing. Do I need to run this on any server? Or should I add the dependency in my application. If it is the later case, do I need to handle anything in my application?
    Also I was searching where should I configure the db and redis connections in the code base... Could you please assist on this as well ?
    Baoyi Chen
    @leonchen83
    you should add the dependency in your application and write the related code about save to mysql. this jar can help you to get all redis data.
    for example
                    Replicator replicator = new RedisReplicator("redis://127.0.0.1:6379");
                    replicator.addEventListener(new EventListener() {
                        @Override
                        public void onEvent(Replicator replicator, Event event) {
                            // save KeyValuePair event and Command event to mysql
                        }
                    });
    
                    replicator.open();
    Mahadevan-P
    @Mahadevan-P
    whether this code will sync redis and mysql?
    Baoyi Chen
    @leonchen83
    you should replace comment // save KeyValuePair event and Command event to mysql to your code. I can`t provide the code to mysql , because I don't know your business logic, your mysql table schema and etc.
    the KeyValuePair event is the data from redis, and parsed to KeyValuePair
    Mahadevan-P
    @Mahadevan-P
    the data which is storing in mysql can be retrieved from redis.but I can't able to update the data in redis.but the data updated in mysql.shall i send my code to ur mail??
    Baoyi Chen
    @leonchen83
    this is not related redis-replicator, can't help you
    Mahadevan-P
    @Mahadevan-P
    ok thanks