Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
Rocketmq
提交
9de6cb78
R
Rocketmq
项目概览
s920243400
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9de6cb78
编写于
4月 03, 2019
作者:
C
cengfeng lzy
提交者:
ShannonDing
4月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify for building native image
上级
b80c2629
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
97 addition
and
0 deletion
+97
-0
client/pom.xml
client/pom.xml
+32
-0
client/src/main/java/org/apache/rocketmq/client/Producer.java
...nt/src/main/java/org/apache/rocketmq/client/Producer.java
+38
-0
client/src/main/java/org/apache/rocketmq/client/log/ClientLogger.java
...ain/java/org/apache/rocketmq/client/log/ClientLogger.java
+5
-0
client/svm.sh
client/svm.sh
+21
-0
pom.xml
pom.xml
+1
-0
未找到文件。
client/pom.xml
浏览文件 @
9de6cb78
...
...
@@ -63,4 +63,36 @@
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
2.4.1
</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
<!-- MainClass in mainfest make a executable jar -->
<archive>
<manifest>
<mainClass>
org.apache.rocketmq.client.Producer
</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<!-- bind to the packaging phase -->
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
client/src/main/java/org/apache/rocketmq/client/Producer.java
0 → 100644
浏览文件 @
9de6cb78
/*
Main entry for building native image
*/
package
org.apache.rocketmq.client
;
import
org.apache.rocketmq.client.exception.MQClientException
;
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
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
{
DefaultMQProducer
producer
=
new
DefaultMQProducer
(
"ProducerGroupName"
);
producer
.
start
();
for
(
int
i
=
0
;
i
<
128
;
i
++)
try
{
{
Message
msg
=
new
Message
(
"TopicTest"
,
"TagA"
,
"OrderID188"
,
"Hello world"
.
getBytes
(
RemotingHelper
.
DEFAULT_CHARSET
));
SendResult
sendResult
=
producer
.
send
(
msg
);
System
.
out
.
printf
(
"%s%n"
,
sendResult
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
producer
.
shutdown
();
}
}
client/src/main/java/org/apache/rocketmq/client/log/ClientLogger.java
浏览文件 @
9de6cb78
...
...
@@ -71,9 +71,14 @@ public class ClientLogger {
Layout
layout
=
LoggingBuilder
.
newLayoutBuilder
().
withDefaultLayout
().
build
();
/*
rocketmqClientAppender = LoggingBuilder.newAppenderBuilder()
.withRollingFileAppender(logFileName, maxFileSize, maxFileIndex)
.withAsync(false, queueSize).withName(ROCKETMQ_CLIENT_APPENDER_NAME).withLayout(layout).build();
*/
rocketmqClientAppender
=
LoggingBuilder
.
newAppenderBuilder
()
.
withConsoleAppender
(
"System.out"
)
.
withName
(
ROCKETMQ_CLIENT_APPENDER_NAME
).
withLayout
(
layout
).
build
();
Logger
.
getRootLogger
().
addAppender
(
rocketmqClientAppender
);
}
...
...
client/svm.sh
0 → 100755
浏览文件 @
9de6cb78
#!/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"
# 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"
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
pom.xml
浏览文件 @
9de6cb78
...
...
@@ -93,6 +93,7 @@
</issueManagement>
<properties>
<checkstyle.skip>
true
</checkstyle.skip>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录