删除冗余代码
parent
42b01d79d2
commit
b603f7ca18
@ -1,40 +0,0 @@
|
|||||||
package weaver.interfaces.dito.mq;
|
|
||||||
|
|
||||||
import com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
|
|
||||||
import com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
|
|
||||||
import com.alibaba.rocketmq.client.consumer.listener.MessageListenerConcurrently;
|
|
||||||
import com.alibaba.rocketmq.common.message.MessageExt;
|
|
||||||
import weaver.general.BaseBean;
|
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class RocketMsgListener implements MessageListenerConcurrently {
|
|
||||||
@Override
|
|
||||||
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
|
|
||||||
BaseBean bb = new BaseBean();
|
|
||||||
MessageExt msg = msgs.get(0);
|
|
||||||
|
|
||||||
RocketmqUtil rocketmqUtil = new RocketmqUtil();
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
bb.writeLog("Consumer---3----"+new String(msg.getBody()));
|
|
||||||
String msgdata = new String(msg.getBody(),"UTF-8");
|
|
||||||
if(!"".equals(msgdata))
|
|
||||||
{
|
|
||||||
String data = msgdata.substring(msgdata.indexOf("{"));
|
|
||||||
int errcount = rocketmqUtil.updateOrgData(data);
|
|
||||||
bb.writeLog("Consumer---errcount---:"+errcount);
|
|
||||||
}
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
bb.writeLog("Consumer---UnsupportedEncodingException---e:"+e);
|
|
||||||
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
|
|
||||||
}
|
|
||||||
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue