From 62a447d89331aee1feae7724c7616aa1bb2cfe79 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 16 十月 2024 14:28:37 +0800 Subject: [PATCH] 将CMQ替换为rabbitmq --- fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/TestRocketMQCosumer.java | 54 +++++++++++++++++++++++++++--------------------------- 1 files changed, 27 insertions(+), 27 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/TestRocketMQCosumer.java b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/TestRocketMQCosumer.java index 3843d2c..b534501 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/TestRocketMQCosumer.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/TestRocketMQCosumer.java @@ -1,27 +1,27 @@ -package com.yeshi.fanli.util.rocketmq.consumer; - -import java.io.UnsupportedEncodingException; -import java.util.List; - -import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; -import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; -import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; -import org.apache.rocketmq.common.message.MessageExt; -import org.springframework.stereotype.Component; - -@Component -public class TestRocketMQCosumer implements MessageListenerConcurrently { - - @Override - public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> arg0, ConsumeConcurrentlyContext arg1) { - for (MessageExt msg : arg0) { - try { - System.out.println(new String(msg.getBody(), "UTF-8")); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; - } - -} +package com.yeshi.fanli.util.rocketmq.consumer; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.springframework.stereotype.Component; + +@Component +public class TestRocketMQCosumer implements MessageListenerConcurrently { + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> arg0, ConsumeConcurrentlyContext arg1) { + for (MessageExt msg : arg0) { + try { + System.out.println(new String(msg.getBody(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + +} -- Gitblit v1.8.0