Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
bbfe7ec1
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bbfe7ec1
编写于
12月 20, 2018
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimise
上级
dbc1b906
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
24 addition
and
80 deletion
+24
-80
whatsmars-mq/whatsmars-mq-kafka/pom.xml
whatsmars-mq/whatsmars-mq-kafka/pom.xml
+0
-12
whatsmars-mq/whatsmars-mq-kafka/src/test/java/org/hongxi/whatsmars/kafka/KafkaTests.java
.../src/test/java/org/hongxi/whatsmars/kafka/KafkaTests.java
+0
-7
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer4.java
.../hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer4.java
+3
-0
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer5.java
.../hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer5.java
+3
-0
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/producer/ProducerApplication.java
...whatsmars/rocketmq/boot/producer/ProducerApplication.java
+16
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-kafka/README.md
...spring-boot-samples/whatsmars-boot-sample-kafka/README.md
+1
-0
whatsmars-spring/down.sh
whatsmars-spring/down.sh
+0
-1
whatsmars-spring/pom.xml
whatsmars-spring/pom.xml
+0
-23
whatsmars-spring/src/conf/properties/system.properties
whatsmars-spring/src/conf/properties/system.properties
+0
-0
whatsmars-spring/src/main/assembly/zip.xml
whatsmars-spring/src/main/assembly/zip.xml
+0
-35
whatsmars-spring/src/main/resources/spring-context.xml
whatsmars-spring/src/main/resources/spring-context.xml
+1
-1
whatsmars-spring/start.sh
whatsmars-spring/start.sh
+0
-1
未找到文件。
whatsmars-mq/whatsmars-mq-kafka/pom.xml
浏览文件 @
bbfe7ec1
...
...
@@ -20,18 +20,6 @@
<groupId>
org.springframework.kafka
</groupId>
<artifactId>
spring-kafka
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.kafka
</groupId>
<artifactId>
spring-kafka-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
whatsmars-mq/whatsmars-mq-kafka/src/test/java/org/hongxi/whatsmars/kafka/KafkaTests.java
已删除
100644 → 0
浏览文件 @
dbc1b906
package
org.hongxi.whatsmars.kafka
;
/**
* Created by shenhongxi on 2018/12/12.
*/
public
class
KafkaTests
{
}
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer4.java
浏览文件 @
bbfe7ec1
...
...
@@ -6,6 +6,9 @@ import org.apache.rocketmq.spring.starter.core.RocketMQListener;
import
org.apache.rocketmq.spring.starter.enums.ConsumeMode
;
import
org.springframework.stereotype.Service
;
/**
* 顺序消息消费失败,默认不重试(本人修改点)
*/
@Slf4j
@Service
@RocketMQMessageListener
(
topic
=
"test-topic-4"
,
consumerGroup
=
"my-consumer_test-topic-4"
,
...
...
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/consumer/MyConsumer5.java
浏览文件 @
bbfe7ec1
...
...
@@ -7,6 +7,9 @@ import org.apache.rocketmq.spring.starter.core.RocketMQListener;
import
org.apache.rocketmq.spring.starter.enums.ConsumeMode
;
import
org.springframework.stereotype.Service
;
/**
* 配置重试次数(本人修改点) reconsumeTimes
*/
@Slf4j
@Service
@RocketMQMessageListener
(
topic
=
"test-topic-4"
,
consumerGroup
=
"my-consumer_test-topic-5"
,
...
...
whatsmars-mq/whatsmars-mq-rocketmq/src/main/java/org/hongxi/whatsmars/rocketmq/boot/producer/ProducerApplication.java
浏览文件 @
bbfe7ec1
package
org.hongxi.whatsmars.rocketmq.boot.producer
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.rocketmq.client.producer.SendCallback
;
import
org.apache.rocketmq.client.producer.SendResult
;
import
org.apache.rocketmq.spring.starter.core.RocketMQTemplate
;
import
org.apache.rocketmq.spring.starter.enums.MessageDelayLevel
;
import
org.hongxi.whatsmars.rocketmq.boot.OrderPaidEvent
;
...
...
@@ -11,6 +14,7 @@ import org.springframework.messaging.support.MessageBuilder;
import
java.math.BigDecimal
;
@Slf4j
@SpringBootApplication
public
class
ProducerApplication
implements
CommandLineRunner
{
@Autowired
...
...
@@ -31,7 +35,19 @@ public class ProducerApplication implements CommandLineRunner {
rocketMQTemplate
.
send
(
"test-topic-1"
,
MessageBuilder
.
withPayload
(
"Hello, World! I'm from spring message"
).
build
());
rocketMQTemplate
.
convertAndSend
(
"test-topic-2"
,
new
OrderPaidEvent
(
"T_001"
,
new
BigDecimal
(
"88.00"
)));
rocketMQTemplate
.
sendDelayed
(
"test-topic-1"
,
MessageBuilder
.
withPayload
(
"I'm delayed message"
).
build
(),
MessageDelayLevel
.
TIME_1M
);
rocketMQTemplate
.
sendOneWay
(
"test-topic-1"
,
MessageBuilder
.
withPayload
(
"I'm one way message"
).
build
());
rocketMQTemplate
.
syncSendOrderly
(
"test-topic-4"
,
MessageBuilder
.
withPayload
(
"I'm order message"
).
build
(),
"1234"
);
rocketMQTemplate
.
asyncSend
(
"test-topic-1"
,
MessageBuilder
.
withPayload
(
"I'm async message"
).
build
(),
new
SendCallback
()
{
@Override
public
void
onSuccess
(
SendResult
sendResult
)
{
log
.
info
(
"async: {}"
,
sendResult
);
}
@Override
public
void
onException
(
Throwable
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
});
System
.
out
.
println
(
"send finished!"
);
// rocketMQTemplate.destroy(); // notes: once rocketMQTemplate be destroyed, you can not send any message again with this rocketMQTemplate
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-kafka/README.md
0 → 100644
浏览文件 @
bbfe7ec1
[
kafka原理与特性
](
https://blog.csdn.net/javahongxi/article/details/85109383
)
\ No newline at end of file
whatsmars-spring/down.sh
已删除
100644 → 0
浏览文件 @
dbc1b906
#!bin/sh
\ No newline at end of file
whatsmars-spring/pom.xml
浏览文件 @
bbfe7ec1
...
...
@@ -49,28 +49,5 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<id>
assembly:package
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/zip.xml
</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
whatsmars-spring/src/conf/properties/system.properties
已删除
100644 → 0
浏览文件 @
dbc1b906
whatsmars-spring/src/main/assembly/zip.xml
已删除
100644 → 0
浏览文件 @
dbc1b906
<assembly
xmlns=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"
>
<id>
release
</id>
<formats>
<format>
zip
</format>
</formats>
<fileSets>
<fileSet>
<directory>
${project.basedir}/src/conf
</directory>
<outputDirectory>
/conf
</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>
${project.basedir}/start.sh
</source>
<outputDirectory>
/
</outputDirectory>
</file>
<file>
<source>
${project.basedir}/down.sh
</source>
<outputDirectory>
/
</outputDirectory>
</file>
</files>
<dependencySets>
<dependencySet>
<useProjectArtifact>
true
</useProjectArtifact>
<outputDirectory>
lib
</outputDirectory>
<!-- 将scope为runtime的依赖包打包到lib目录下。 -->
<scope>
runtime
</scope>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
whatsmars-spring/src/main/resources/spring-context.xml
浏览文件 @
bbfe7ec1
...
...
@@ -15,7 +15,7 @@
<property
name=
"cnName"
value=
"火星"
/>
</bean>
<!-- 线程池 -->
<!-- 线程池
建议用这个,不建议用Executes (队列长度或线程数不可控)
-->
<bean
id=
"taskExecutor"
class=
"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"
>
<!-- 核心线程数 -->
<property
name=
"corePoolSize"
value=
"10"
/>
...
...
whatsmars-spring/start.sh
已删除
100644 → 0
浏览文件 @
dbc1b906
#!bin/sh
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录