diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/EventMeshConsumer.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/EventMeshConsumer.java index cb81a1d899..3708dec0a4 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/EventMeshConsumer.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/EventMeshConsumer.java @@ -193,8 +193,8 @@ public synchronized void init() throws Exception { .build(); String topic = event.getSubject(); - String bizSeqNo = getEventExtension(event, ProtocolKey.ClientInstanceKey.BIZSEQNO, ""); - String uniqueId = getEventExtension(event, ProtocolKey.ClientInstanceKey.UNIQUEID, ""); + String bizSeqNo = getEventExtension(event, ProtocolKey.ClientInstanceKey.BIZSEQNO); + String uniqueId = getEventExtension(event, ProtocolKey.ClientInstanceKey.UNIQUEID); if (messageLogger.isDebugEnabled()) { messageLogger.debug("message|mq2eventMesh|topic={}|msg={}", topic, event); @@ -253,9 +253,9 @@ public synchronized void init() throws Exception { log.info("EventMeshConsumer [{}] inited.............", consumerGroupConf.getConsumerGroup()); } - private String getEventExtension(CloudEvent event, String protocolKey, String defaultValue) { + private String getEventExtension(CloudEvent event, String protocolKey) { Object extension = event.getExtension(protocolKey); - return Objects.isNull(extension) ? defaultValue : extension.toString(); + return Objects.isNull(extension) ? "" : extension.toString(); } public synchronized void start() throws Exception {