Skip to content

[Bug] Empty class member cause NullpointerException #4770

@scwlkq

Description

@scwlkq

Search before asking

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

Environment

Mac

EventMesh version

master

What happened

Runtime(Storage:Local Rocketmq ) + Http Source Connector

image
请求的路径应该是:curl发送请求->CloudEvent->ConnectRecord-> runtime(storage)
然后我发现是在CloudEvent->ConnectRecord转化的过程中position属性为null:
image

但是关于消息写入的offset和partition这些属性 应该是由storage的相关模块写入,但是我在CloudEventUtil里看到了关于这个的todo?

How to reproduce

run Runtime(Storage:Local Rocketmq ) + Http Source Connector

Debug logs

2024-02-16 00:11:21,099 DEBUG [vert.x-eventloop-thread-0] ZlibCodecFactory(ZlibCodecFactory.java:39) - -Dio.netty.noJdkZlibDecoder: false
2024-02-16 00:11:21,099 DEBUG [vert.x-eventloop-thread-0] ZlibCodecFactory(ZlibCodecFactory.java:42) - -Dio.netty.noJdkZlibEncoder: false
2024-02-16 00:11:21,170 INFO  [vert.x-eventloop-thread-0] HttpSourceConnector(HttpSourceConnector.java:100) - [HttpSourceConnector] Succeed to convert payload into CloudEvent. StatusCode=200
2024-02-16 00:11:21,174 INFO  [pool-3-thread-1] CloudEventUtil(CloudEventUtil.java:69) - handle receive events testdata



Exception in thread "pool-2-thread-1" java.lang.NullPointerException
	at org.apache.eventmesh.openconnect.offsetmgmt.api.storage.OffsetStorageWriterImpl.writeOffset(OffsetStorageWriterImpl.java:57)
	at java.util.HashMap.forEach(HashMap.java:1290)
	at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1507)
	at org.apache.eventmesh.openconnect.SourceWorker.commitOffsets(SourceWorker.java:346)
	at org.apache.eventmesh.openconnect.SourceWorker.startPollAndSend(SourceWorker.java:219)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions