Skip to content

[Bug] Incorrect validation may cause the batch send of events to fail #3273

@epiao55

Description

@epiao55

Search before asking

  • I had searched in the issues and found no similar issues.

Environment

Windows

EventMesh version

master

What happened

path is org/apache/eventmesh/runtime/core/protocol/http/processor/BatchSendMessageProcessor.java

i think this is a bug when i read code of master branch. This will cause the batch send of events to fail.

            if (eventData != null || StringUtils.isBlank(batchId)
                    || StringUtils.isBlank(producerGroup)
                    || eventSize != eventList.size()) {
                responseEventMeshCommand = asyncContext.getRequest().createHttpCommandResponse(
                        sendMessageBatchResponseHeader,
                        SendMessageBatchResponseBody.buildBody(EventMeshRetCode.EVENTMESH_PROTOCOL_BODY_ERR.getRetCode(),
                                EventMeshRetCode.EVENTMESH_PROTOCOL_BODY_ERR.getErrMsg()));
                asyncContext.onComplete(responseEventMeshCommand);
                return;
            }

The validation of eventData should be changed to '==null'.

How to reproduce

just read the code

Debug logs

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions