diff --git a/client/config/reflect-config.json b/client/config/reflect-config.json new file mode 100644 index 0000000000000000000000000000000000000000..d369915f4abdf9be27f57834453564d0f4f002c6 --- /dev/null +++ b/client/config/reflect-config.json @@ -0,0 +1,170 @@ +[ + + { + "name":"[B" + }, + { + "name":"[J" + }, + { + "name":"[Ljava.lang.Object;" + }, + { + "name":"io.netty.channel.socket.nio.NioSocketChannel", + "methods":[{ "name":"", "parameterTypes":[] }] + }, + { + "name":"java.beans.Transient" + }, + { + "name":"java.lang.Byte" + }, + { + "name":"java.lang.Class" + }, + { + "name":"java.lang.Comparable", + "allPublicMethods":true + }, + { + "name":"java.lang.Float" + }, + { + "name":"java.lang.Integer" + }, + { + "name":"java.lang.Long" + }, + { + "name":"java.lang.Object" + }, + { + "name":"java.lang.String", + "fields":[{"name":"value"}] + }, + { + "name":"java.lang.System" + }, + { + "name":"java.nio.Bits", + "methods":[{ "name":"unaligned", "parameterTypes":[] }] + }, + { + "name":"java.nio.Buffer", + "fields":[{"name":"address"}] + }, + { + "name":"java.nio.DirectByteBuffer", + "fields":[{"name":"cleaner"}], + "methods":[{ "name":"", "parameterTypes":["long", "int"] }] + }, + { + "name":"java.nio.file.Path" + }, + { + "name":"org.apache.rocketmq.common.protocol.header.SendMessageRequestHeaderV2", + "allDeclaredFields":true + }, + { + "name":"org.apache.rocketmq.common.protocol.header.SendMessageResponseHeader", + "allDeclaredFields":true, + "methods":[{ "name":"", "parameterTypes":[] }] + }, + { + "name":"org.apache.rocketmq.common.protocol.header.UnregisterClientRequestHeader", + "allDeclaredFields":true + }, + { + "name":"org.apache.rocketmq.common.protocol.header.namesrv.GetRouteInfoRequestHeader", + "allDeclaredFields":true + }, + { + "name":"org.apache.rocketmq.common.protocol.heartbeat.HeartbeatData", + "allDeclaredFields":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.common.protocol.heartbeat.ProducerData", + "allDeclaredFields":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.common.protocol.route.BrokerData", + "allDeclaredFields":true, + "allDeclaredConstructors":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.common.protocol.route.QueueData", + "allDeclaredFields":true, + "allDeclaredConstructors":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.common.protocol.route.TopicRouteData", + "allDeclaredFields":true, + "allDeclaredConstructors":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.remoting.protocol.LanguageCode", + "fields":[ + {"name":"CPP"}, + {"name":"DELPHI"}, + {"name":"DOTNET"}, + {"name":"ERLANG"}, + {"name":"GO"}, + {"name":"HTTP"}, + {"name":"JAVA"}, + {"name":"OMS"}, + {"name":"OTHER"}, + {"name":"PHP"}, + {"name":"PYTHON"}, + {"name":"RUBY"} + ] + }, + { + "name":"org.apache.rocketmq.remoting.protocol.RemotingCommand", + "allDeclaredFields":true, + "allDeclaredConstructors":true, + "allPublicFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.remoting.protocol.RemotingSerializable", + "allDeclaredFields":true, + "allPublicMethods":true + }, + { + "name":"org.apache.rocketmq.remoting.protocol.SerializeType", + "fields":[ + {"name":"JSON"}, + {"name":"ROCKETMQ"} + ] + }, + { + "name":"sun.misc.Cleaner", + "methods":[{ "name":"clean", "parameterTypes":[] }] + }, + { + "name":"sun.misc.Unsafe", + "fields":[{"name":"theUnsafe"}], + "methods":[{ "name":"copyMemory", "parameterTypes":["java.lang.Object", "long", "java.lang.Object", "long", "long"] }] + }, + { + "name":"sun.misc.VM", + "methods":[{ "name":"maxDirectMemory", "parameterTypes":[] }] + }, + { + "name":"sun.nio.ch.SelectorImpl", + "fields":[ + {"name":"publicSelectedKeys"}, + {"name":"selectedKeys"} + ] + } +] diff --git a/client/src/main/java/org/apache/rocketmq/client/Producer.java b/client/src/main/java/org/apache/rocketmq/client/Producer.java index 6751d40f48f0197ddafb36d48008cad72f51d602..ff87cd6d498c3a28f827fb0ed03819c7c3d034b6 100644 --- a/client/src/main/java/org/apache/rocketmq/client/Producer.java +++ b/client/src/main/java/org/apache/rocketmq/client/Producer.java @@ -8,13 +8,16 @@ import org.apache.rocketmq.client.producer.DefaultMQProducer; import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.common.message.Message; import org.apache.rocketmq.remoting.common.RemotingHelper; + +import com.alibaba.fastjson.parser.ParserConfig; + import io.netty.handler.logging.LoggingHandler; import io.netty.handler.logging.LogLevel; public class Producer { private static final LoggingHandler log = new LoggingHandler(LogLevel.DEBUG); public static void main(String[] args) throws MQClientException, InterruptedException { - + ParserConfig.global.setAsmEnable(false); DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName"); producer.start(); diff --git a/client/svm.sh b/client/svm.sh index 5a094339e2cf21271af50b9f91e1b425faf03609..e13cfcff2d9e7c2316d7cd7f5aa12d8feab5f071 100755 --- a/client/svm.sh +++ b/client/svm.sh @@ -1,21 +1,24 @@ #!/bin/bash SVM_OPT="--allow-incomplete-classpath --report-unsupported-elements-at-runtime" -SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec" SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator" SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator" SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnApplicationProtocolNegotiator" SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkNpnSslEngine" SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.JdkAlpnSslEngine" +SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.util.internal.JavassistTypeParameterMatcherGenerator" +SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=com.alibaba.fastjson.serializer.JodaCodec" # testing #SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.SelfSignedCertificate" #SVM_OPT="${SVM_OPT} --delay-class-initialization-to-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom" SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.SelfSignedCertificate" SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=io.netty.handler.ssl.util.ThreadLocalInsecureRandom" -SVM_OPT="${SVM_OPT} --enable-url-protocols=http" +SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.serializer.SerializeConfig" +SVM_OPT="${SVM_OPT} --rerun-class-initialization-at-runtime=com.alibaba.fastjson.parser.ParserConfig" +SVM_OPT="${SVM_OPT} --enable-url-protocols=http" WORKDIR=`pwd` -CONFIG_OPT=" -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces --allow-incomplete-classpath" -#native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc15-dev/bin/native-image -native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image -$native_image $CONFIG_OPT $SVM_OPT -jar target/rocketmq-client-4.4.1-SNAPSHOT-jar-with-dependencies.jar +CONFIG_OPT="-H:ConfigurationFileDirectories=${WORKDIR}/config -Dio.netty.noUnsafe=true -H:+ReportExceptionStackTraces --allow-incomplete-classpath" +native_image=/home/cengfeng.lzy/GraalDev/graal/vm/mxbuild/linux-amd64/GRAALVM_LIBGRAAL/graalvm-libgraal-1.0.0-rc16-dev/bin/native-image +#native_image=~/tools/graalvm-ce-1.0.0-rc14/bin/native-image +$native_image $CONFIG_OPT $SVM_OPT -jar target/rocketmq-client-4.5.1-SNAPSHOT-jar-with-dependencies.jar