ruanwenjun commented on pull request #376: URL: https://github.com/apache/incubator-eventmesh/pull/376#issuecomment-887446163
@Jackzeng1224 Yes, I can see the log that the message has been sent to kafka. You can use `AsyncSyncRequestInstance` to send async requests, and I find a bug in `LiteProducer` line 218. https://github.com/apache/incubator-eventmesh/blob/737c0f09efeba61a62653d33fd553491af7d0deb/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/LiteProducer.java#L207-L219 This method should be async, but it sends a sync command, I will fix in another pr. And you can modified the line 218 to ```java requestParam.addHeader(ProtocolKey.REQUEST_CODE, String.valueOf(RequestCode.MSG_SEND_ASYNC.getRequestCode())) ``` Then you will see below log in runtime module: ``` 2021-07-27 19:28:37,824 INFO [kafka-producer-network-thread | producer-1] message(SendAsyncMessageProcessor.java:196) - message|eventMesh2mq|REQ|ASYNC|send2MQCost=4ms|topic=TEST-TOPIC-TCP-ASYNC|bizSeqNo=920594188447336930612967879404|uniqueId=243186356065686374194669481534 ``` But the response in `AsyncSyncRequestInstance` is also failed, I think it might be another issue. ```java 2021-07-27 19:48:40,956 DEBUG [main] AsyncSyncRequestInstance(AsyncSyncRequestInstance.java:81) - sendmsg failed org.apache.eventmesh.common.EventMeshException: com.alibaba.fastjson.JSONException: syntax error,except start with { or [,but actually start with error at org.apache.eventmesh.client.http.producer.RRCallbackResponseHandlerAdapter.handleResponse(RRCallbackResponseHandlerAdapter.java:94) ~[eventmesh-sdk-java-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT] at org.apache.eventmesh.client.http.producer.RRCallbackResponseHandlerAdapter.handleResponse(RRCallbackResponseHandlerAdapter.java:41) ~[eventmesh-sdk-java-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222) ~[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164) ~[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139) ~[httpclient-4.5.2.jar:4.5.2] at org.apache.eventmesh.client.http.http.HttpUtil.post(HttpUtil.java:149) ~[eventmesh-sdk-java-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT] at org.apache.eventmesh.client.http.producer.LiteProducer.request(LiteProducer.java:240) ~[eventmesh-sdk-java-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT] at org.apache.eventmesh.http.demo.AsyncSyncRequestInstance.main(AsyncSyncRequestInstance.java:73) ~[main/:?] Caused by: com.alibaba.fastjson.JSONException: syntax error,except start with { or [,but actually start with error at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:684) ~[fastjson-1.2.71.jar:?] at com.alibaba.fastjson.JSON.parseObject(JSON.java:396) ~[fastjson-1.2.71.jar:?] at com.alibaba.fastjson.JSON.parseObject(JSON.java:300) ~[fastjson-1.2.71.jar:?] at com.alibaba.fastjson.JSON.parseObject(JSON.java:573) ~[fastjson-1.2.71.jar:?] at org.apache.eventmesh.client.http.producer.RRCallbackResponseHandlerAdapter.handleResponse(RRCallbackResponseHandlerAdapter.java:89) ~[eventmesh-sdk-java-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT] ... 7 more ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
