You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/05/11 06:58:51 UTC

[GitHub] [incubator-eventmesh] framctr commented on issue #857: [Bug] AsyncSubscribe not found

framctr commented on issue #857:
URL: https://github.com/apache/incubator-eventmesh/issues/857#issuecomment-1123257125

   Hi, thank you for your response.
   I cannot get your results. I will explain better all the steps I do:
   ```
   $ docker run -it --rm openjdk:8 /bin/bash
   
   # cd /opt
   # EVENTMESH_VERSION=1.4.0
   # wget https://github.com/apache/incubator-eventmesh/archive/refs/tags/v${EVENTMESH_VERSION}.tar.gz -O - | tar -xz
   # mv incubator-eventmesh-${EVENTMESH_VERSION} eventmesh-${EVENTMESH_VERSION}
   # cd eventmesh-${EVENTMESH_VERSION}/eventmesh-example
   # sh /opt/eventmesh-${EVENTMESH_VERSION}/gradlew build
   ```
   At the end of the process, if I go to `eventmesh-examples/bin` and launch `tcp_sub.sh` or 
   the publisher, it doesn't work.
   ```
   # cd bin
   # ls
   http_pub.sh  http_sub.sh  tcp_pub.sh  tcp_pub_broadcast.sh  tcp_sub.sh  tcp_sub_broadcast.sh
   # bash tcp_sub.sh
   tcp_sub.sh: line 27: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
   tcp_sub.sh: line 28: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
   tcp_sub_demo use java location= /usr/local/openjdk-8/bin/java
   DEMO_HOME : /data/em-example/dist/eventmesh-examples, DEMO_LOG_HOME : /data/em-example/dist/eventmesh-examples/logs
   cat: /data/em-example/dist/eventmesh-examples/conf/server.env: No such file or directory
   ```
   I tried to create a similar launch script in this way:
   ```
   # cd /opt/eventmesh-${EVENTMESH_VERSION}/eventmesh-examples
   # mkdir -p demo-app/conf
   # mkdir -p demo-app/apps
   # mkdir -p demo-app/libs
   # mv build/resources/main/* demo-app/conf
   # mv build/libs/* demo-app/libs
   # mv build/classes demo-app/apps
   # # Add missing library slf4j
   # SLF4J_VERSION=1.7.9
   # wget -P demo-app/libs https://repo1.maven.org/maven2/org/slf4j/slf4j-api/${SLF4J_VERSION}/slf4j-api-${SLF4J_VERSION}.jar
   # wget -P demo-app/libs https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/${SLF4J_VERSION}/slf4j-simple-${SLF4J_VERSION}.jar
   # cd demo-app
   # pwd
   /opt/eventmesh-1.4.0/eventmesh-examples/demo-app
   # ls
   apps  conf  libs
   ```
   Now I add in `demo-app` the following scripts (inspired by the ones in the project):
   #### tcp_pub.sh
   ```bash
   #!/bin/bash
   
   # This script will launch the demo app as TCP publisher.
   
   # The configuration of different servers may be inconsistent,
   # adding these configurations can avoid the problem of garbled characters
   # export LANG=en_US.UTF-8
   # export LC_CTYPE=en_US.UTF-8
   # export LC_ALL=en_US.UTF-8
   
   DEMO_PATH=${1:-$(dirname $0)}
   
   DEMO_LOG_PATH=${DEMO_PATH}/logs
   DEMO_LOG=${DEMO_LOG_PATH}/demo_tcp_pub.log
   
   # create logs folder, if already exist does not show err msg
   mkdir -p "${DEMO_LOG_PATH}" 2> /dev/null
   
   JAVA="$(which java)"
   
   # Java configuration options
   JAVA_OPT=`cat ${DEMO_PATH}/conf/server.env | grep APP_START_JVM_OPTION::: | awk -F ':::' {'print $2'}`
   JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:MaxGCPauseMillis=50"
   JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:${DEMO_PATH}/logs/demo_tcp_pub_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy"
   JAVA_OPT="${JAVA_OPT} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${DEMO_PATH}/logs -XX:ErrorFile=${DEMO_PATH}/logs/hs_err_%p.log"
   JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"
   JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"
   JAVA_OPT="${JAVA_OPT} -XX:+AlwaysPreTouch"
   JAVA_OPT="${JAVA_OPT} -XX:MaxDirectMemorySize=8G"
   JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages -XX:-UseBiasedLocking"
   JAVA_OPT="${JAVA_OPT} -Dio.netty.leakDetectionLevel=advanced"
   JAVA_OPT="${JAVA_OPT} -Dio.netty.allocator.type=pooled"
   JAVA_OPT="${JAVA_OPT} -Djava.security.egd=file:/dev/./urandom"
   JAVA_OPT="${JAVA_OPT} -Dlog4j.configurationFile=${DEMO_PATH}/conf/log4j2.xml"
   #JAVA_OPT="${JAVA_OPT} -Deventmesh.log.home=${DEMO_LOG_PATH}"
   JAVA_OPT="${JAVA_OPT} -DconfPath=${DEMO_PATH}/conf"
   JAVA_OPT="${JAVA_OPT} -Dlog4j2.AsyncQueueFullPolicy=Discard"
   JAVA_OPT="${JAVA_OPT} -Drocketmq.client.logUseSlf4j=true"
   
   DEMO_MAIN=org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish
   
   # Debug and log
   echo "====== tcp publisher demo ======" | tee -a "$DEMO_LOG"
   echo "INFO: Starting at $(date)" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO_PATH: ${DEMO_PATH}" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO_LOG_PATH : ${DEMO_LOG_PATH}" | tee -a "$DEMO_LOG"
   echo "INFO: JAVA: $JAVA" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO MAIN: $DEMO_MAIN" | tee -a "$DEMO_LOG"
   
   $JAVA $JAVA_OPT -classpath ${DEMO_PATH}/conf:${DEMO_PATH}/apps/*:${DEMO_PATH}/libs/* $DEMO_MAIN | tee -a "$DEMO_LOG"
   ```
   
   #### tcp_sub.sh
   ```bash
   #!/bin/bash
   
   # This script will launch the demo app as TCP publisher.
   
   # The configuration of different servers may be inconsistent,
   # adding these configurations can avoid the problem of garbled characters
   # export LANG=en_US.UTF-8
   # export LC_CTYPE=en_US.UTF-8
   # export LC_ALL=en_US.UTF-8
   
   DEMO_PATH=${1:-$(dirname $0)}
   
   DEMO_LOG_PATH=${DEMO_PATH}/logs
   DEMO_LOG=${DEMO_LOG_PATH}/demo_tcp_sub.log
   
   # create logs folder, if already exist does not show err msg
   mkdir -p "${DEMO_LOG_PATH}" 2> /dev/null
   
   JAVA="$(which java)"
   
   # Java configuration options
   JAVA_OPT=`cat ${DEMO_PATH}/conf/server.env | grep APP_START_JVM_OPTION::: | awk -F ':::' {'print $2'}`
   JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:MaxGCPauseMillis=50"
   JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:${DEMO_PATH}/logs/demo_tcp_sub_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy"
   JAVA_OPT="${JAVA_OPT} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${DEMO_PATH}/logs -XX:ErrorFile=${DEMO_PATH}/logs/hs_err_%p.log"
   JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"
   JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"
   JAVA_OPT="${JAVA_OPT} -XX:+AlwaysPreTouch"
   JAVA_OPT="${JAVA_OPT} -XX:MaxDirectMemorySize=8G"
   JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages -XX:-UseBiasedLocking"
   JAVA_OPT="${JAVA_OPT} -Dio.netty.leakDetectionLevel=advanced"
   JAVA_OPT="${JAVA_OPT} -Dio.netty.allocator.type=pooled"
   JAVA_OPT="${JAVA_OPT} -Djava.security.egd=file:/dev/./urandom"
   JAVA_OPT="${JAVA_OPT} -Dlog4j.configurationFile=${DEMO_PATH}/conf/log4j2.xml"
   #JAVA_OPT="${JAVA_OPT} -Deventmesh.log.home=${DEMO_LOG_PATH}"
   JAVA_OPT="${JAVA_OPT} -DconfPath=${DEMO_PATH}/conf"
   JAVA_OPT="${JAVA_OPT} -Dlog4j2.AsyncQueueFullPolicy=Discard"
   JAVA_OPT="${JAVA_OPT} -Drocketmq.client.logUseSlf4j=true"
   
   DEMO_MAIN=org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe
   
   # Debug and log
   echo "====== tcp subscriber demo ======" | tee -a "$DEMO_LOG"
   echo "INFO: Starting at $(date)" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO_PATH: ${DEMO_PATH}" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO_LOG_PATH : ${DEMO_LOG_PATH}" | tee -a "$DEMO_LOG"
   echo "INFO: JAVA: $JAVA" | tee -a "$DEMO_LOG"
   echo "INFO: DEMO MAIN: $DEMO_MAIN" | tee -a "$DEMO_LOG"
   
   $JAVA $JAVA_OPT -classpath ${DEMO_PATH}/conf:${DEMO_PATH}/apps/*:${DEMO_PATH}/libs/* $DEMO_MAIN | tee -a "$DEMO_LOG"
   ```
   
   Now, if I launch them, tcp_pub works, while the subscriber says that `org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe` cannot be found.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org