9997766 opened a new issue, #4805:
URL: https://github.com/apache/eventmesh/issues/4805

   ### 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
   
   Linux
   
   ### EventMesh version
   
   1.10.0
   
   ### What happened
   
   
   
   EventMeshMessageProducer.java have a problem, exceptions should not be 
swallowed.
   This can cause serious business problems. When and in which version can you 
fix this issue?
   
   
       @Override
       public Response publish(List<EventMeshMessage> messages) {
   
           if (CollectionUtils.isEmpty(messages)) {
               return null;
           }
           CloudEventBatch cloudEventBatch = 
EventMeshCloudEventBuilder.buildEventMeshCloudEventBatch(messages, 
clientConfig, PROTOCOL_TYPE);
           try {
               CloudEvent response = 
publisherClient.batchPublish(cloudEventBatch);
               Response parsedResponse = Response.builder()
                   .respCode(EventMeshCloudEventUtils.getResponseCode(response))
                   
.respMsg(EventMeshCloudEventUtils.getResponseMessage(response))
                   .respTime(EventMeshCloudEventUtils.getResponseTime(response))
                   .build();
               log.info("Received response:{}", parsedResponse);
               return parsedResponse;
           } catch (Exception e) {
               log.error("Error in BatchPublish message {}", messages, e);
           }
           return null;
       }
   
   ### How to reproduce
   
   I suggest whether we can modify it as follow:
   
       @Override
       public Response publish(List<EventMeshMessage> messages)  throw 
EventMeshException{
   
           if (CollectionUtils.isEmpty(messages)) {
               return null;
           }
           CloudEventBatch cloudEventBatch = 
EventMeshCloudEventBuilder.buildEventMeshCloudEventBatch(messages, 
clientConfig, PROTOCOL_TYPE);
           try {
               CloudEvent response = 
publisherClient.batchPublish(cloudEventBatch);
               Response parsedResponse = Response.builder()
                   .respCode(EventMeshCloudEventUtils.getResponseCode(response))
                   
.respMsg(EventMeshCloudEventUtils.getResponseMessage(response))
                   .respTime(EventMeshCloudEventUtils.getResponseTime(response))
                   .build();
               log.info("Received response:{}", parsedResponse);
               return parsedResponse;
           } catch (Exception e) {
               log.error("Error in BatchPublish message {}", messages, e);
               throws new EventMeshException("Error in BatchPublish message 
{}", e );
           }
           return null;
       }
   
   
   
   ### Debug logs
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct) *


-- 
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: issues-unsubscr...@eventmesh.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@eventmesh.apache.org
For additional commands, e-mail: issues-h...@eventmesh.apache.org

Reply via email to