Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
=
committed
Dec 24, 2017
1 parent
dfe334f
commit 0fc2d1b
Showing
8 changed files
with
56 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...-boot-rocketmq/src/main/java/com/rhwayfun/springboot/rocketmq/mq/DemoRocketMqContent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...cketmq/src/main/java/com/rhwayfun/springboot/rocketmq/mq/DemoRocketMqProducerExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.rhwayfun.springboot.rocketmq.mq; | ||
|
||
import io.github.rhwayfun.springboot.rocketmq.starter.common.DefaultRocketMqProducer; | ||
import org.apache.rocketmq.common.message.Message; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.annotation.Resource; | ||
import java.util.Timer; | ||
import java.util.TimerTask; | ||
|
||
/** | ||
* @author rhwayfun | ||
* @since 0.0.1 | ||
*/ | ||
@Component | ||
public class DemoRocketMqProducerExample { | ||
|
||
@Resource | ||
private DefaultRocketMqProducer producer; | ||
|
||
@PostConstruct | ||
public void execute() { | ||
new Timer().schedule(new TimerTask() { | ||
@Override | ||
public void run() { | ||
DemoRocketMqContent content = new DemoRocketMqContent(); | ||
content.setCityId(1); | ||
content.setDesc("城市"); | ||
Message msg = new Message("TopicA", "TagA", content.toString().getBytes()); | ||
boolean sendResult = producer.sendMsg(msg); | ||
System.out.println("发送结果:" + sendResult); | ||
} | ||
}, 0, 10000); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
spring-boot-rocketmq/src/main/java/com/rhwayfun/springboot/rocketmq/mq/DemoRocketMqTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ng-boot-rocketmq/src/main/java/com/rhwayfun/springboot/rocketmq/mq/DemoRocketMqTopic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
...t-rocketmq/src/main/java/com/rhwayfun/springboot/rocketmq/other/DemoRocketMqConsumer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters