-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
7 changed files
with
60 additions
and
6 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
28 changes: 28 additions & 0 deletions
28
...tmq-springboot-consumer/src/main/java/com/hk/rocketmq/listener/DelayConsumerListener.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,28 @@ | ||
package com.hk.rocketmq.listener; | ||
|
||
import com.hk.commons.util.date.DatePattern; | ||
import com.hk.commons.util.date.DateTimeUtils; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; | ||
import org.apache.rocketmq.spring.core.RocketMQListener; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* 消费者接受延迟消息 | ||
* | ||
* @author kevin | ||
* @date 2019-11-22 16:27 | ||
*/ | ||
@Slf4j | ||
@Service | ||
@RocketMQMessageListener(topic = "delay-topic", consumerGroup = "delay-group") | ||
public class DelayConsumerListener implements RocketMQListener<String> { | ||
|
||
@Override | ||
public void onMessage(String message) { | ||
log.debug("receive delay Message:{},currentDate:{}", | ||
message, DateTimeUtils.localDateTimeToString(LocalDateTime.now(), DatePattern.YYYY_MM_DD_HH_MM_SS)); | ||
} | ||
} |
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
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