Closed Fungx closed 10 months ago
Good. Is there a way for the sender to get that there is an error in one of the packets sent without looking at the EM logs?
Good. Is there a way for the sender to get that there is an error in one of the packets sent without looking at the EM logs?
Sender can get it from the http status code. 400
will be returned if there is an error in the conversion.
Search before asking
Environment
Linux
EventMesh version
master
What happened
HTTP source connector stop after receiving an request without attribute
subject
and never response again.How to reproduce
Reproduce
subject
, such asAnalysis
In
HttpSourceConnector#poll
, the conversion from cloudevent to connectRecord is performed.If a cloudevent contains null
subject
,connectRecord.addExtension("topic", event.getSubject())
will throw unexpected NPE, which will stop the connector server.Fix
Check
subject
before saving cloudevents. We don't need to check other attributes likeid
,source
,type
,etc. Because they are required arrtibutes of cloudevents and cloudevents-sdk will do the check intoEvent()
.Debug logs
No response
Are you willing to submit PR?
Code of Conduct