@@ -221,24 +221,16 @@ public SendReceipt syncSendNormalMessage(String destination, byte[] payload) {
221221 */
222222 public SendReceipt syncSendGrpcMessage (String destination , Message <?> message , Duration messageDelayTime , String messageGroup ) {
223223 if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
224- log .error ("send request message failed. destination:{}, message is null " , destination );
225224 throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
226225 }
227226 SendReceipt sendReceipt = null ;
228227 try {
229228 org .apache .rocketmq .client .apis .message .Message rocketMsg = this .createRocketMQMessage (destination , message , messageDelayTime , messageGroup );
230229 Producer grpcProducer = this .getProducer ();
231- try {
232- sendReceipt = grpcProducer .send (rocketMsg );
233- log .info ("Send message successfully, messageId={}" , sendReceipt .getMessageId ());
234- } catch (Throwable t ) {
235- log .error ("Failed to send message" , t );
236- }
230+ return grpcProducer .send (rocketMsg );
237231 } catch (Exception e ) {
238- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
239232 throw new MessagingException (e .getMessage (), e );
240233 }
241- return sendReceipt ;
242234 }
243235
244236
@@ -311,7 +303,6 @@ public CompletableFuture<SendReceipt> asyncSendDelayMessage(String destination,
311303
312304 public CompletableFuture <SendReceipt > asyncSend (String destination , Message <?> message , Duration messageDelayTime , String messageGroup , CompletableFuture <SendReceipt > future ) {
313305 if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
314- log .error ("send request message failed. destination:{}, message is null " , destination );
315306 throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
316307 }
317308 Producer grpcProducer = this .getProducer ();
@@ -329,7 +320,6 @@ public CompletableFuture<SendReceipt> asyncSend(String destination, Message<?> m
329320 });
330321 }
331322 } catch (Exception e ) {
332- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
333323 throw new MessagingException (e .getMessage (), e );
334324 }
335325 return future0 ;
@@ -358,7 +348,6 @@ public Pair<SendReceipt, Transaction> sendMessageInTransaction(String destinatio
358348 */
359349 public Pair <SendReceipt , Transaction > sendTransactionMessage (String destination , Message <?> message ) {
360350 if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
361- log .error ("send request message failed. destination:{}, message is null " , destination );
362351 throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
363352 }
364353 final SendReceipt sendReceipt ;
@@ -368,9 +357,7 @@ public Pair<SendReceipt, Transaction> sendTransactionMessage(String destination,
368357 try {
369358 transaction = grpcProducer .beginTransaction ();
370359 sendReceipt = grpcProducer .send (rocketMsg , transaction );
371- log .info ("Send transaction message successfully, messageId={}" , sendReceipt .getMessageId ());
372360 } catch (ClientException e ) {
373- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
374361 throw new RuntimeException (e );
375362 }
376363 return new Pair <>(sendReceipt , transaction );
0 commit comments