mistyzyq opened a new issue, #2457:
URL: https://github.com/apache/incubator-eventmesh/issues/2457

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Environment
   
   Windows
   
   ### EventMesh version
   
   master
   
   ### What happened
   
   There may be missing some mcessary pareter configurations in the example, 
which causes the excample run failed.
   
   In the main method of class 
org.apache.eventmesh.http.demo.pub.eventmeshmessage.SyncRequestInstance, the 
config of httpclient and producer are as below:
   ```
               EventMeshHttpClientConfig eventMeshClientConfig = 
EventMeshHttpClientConfig.builder()
                       .liteEventMeshAddr(eventMeshIPPort)
                       
.producerGroup(ExampleConstants.DEFAULT_EVENTMESH_TEST_PRODUCER_GROUP)
                       .env("env")
                       .idc("idc")
                       .ip(IPUtils.getLocalAddress())
                       .sys("1234")
                       .pid(String.valueOf(ThreadUtils.getPID())).build();
   
               eventMeshHttpProducer = new 
EventMeshHttpProducer(eventMeshClientConfig);
   
               long startTime = System.currentTimeMillis();
               EventMeshMessage eventMeshMessage = EventMeshMessage.builder()
                       .bizSeqNo(RandomStringUtils.generateNum(30))
                       .content("contentStr with special protocal")
                       .topic(topic)
                       .pid(String.valueOf(ThreadUtils.getPID())).build();
   ```
   When running this example, exceptions will be thrown in the 
eventmesh-runtime, and no response will be received here.
   I have checked all the exceptions, by reading the exception report and 
debugging, all information indicate that:
   1. "username" and "password" in the eventMeshClientConfig can not be null or 
empty, but is missing here;
   2. the parameter "ttl" in eventMeshMessage is required, but is missing here.
   
   I modified both of these codes with reference to the async sample code in 
AsyncPublishInstance, then it works fine.
   
   ### How to reproduce
   
   1. clone the master branch to local
   2. start the eventmesh-runtime with the eventmesh-starter
   3. start the eventmesh-examples, run main method in SyncRequestInstance of 
http.demo, and no response would be received.
   4. if post request with curl, it would be blocked till timeout, with no 
response.
   
   ### Debug logs
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
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]

Reply via email to