@@ -221,24 +221,16 @@ public SendReceipt syncSendNormalMessage(String destination, byte[] payload) {
221
221
*/
222
222
public SendReceipt syncSendGrpcMessage (String destination , Message <?> message , Duration messageDelayTime , String messageGroup ) {
223
223
if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
224
- log .error ("send request message failed. destination:{}, message is null " , destination );
225
224
throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
226
225
}
227
226
SendReceipt sendReceipt = null ;
228
227
try {
229
228
org .apache .rocketmq .client .apis .message .Message rocketMsg = this .createRocketMQMessage (destination , message , messageDelayTime , messageGroup );
230
229
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 );
237
231
} catch (Exception e ) {
238
- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
239
232
throw new MessagingException (e .getMessage (), e );
240
233
}
241
- return sendReceipt ;
242
234
}
243
235
244
236
@@ -311,7 +303,6 @@ public CompletableFuture<SendReceipt> asyncSendDelayMessage(String destination,
311
303
312
304
public CompletableFuture <SendReceipt > asyncSend (String destination , Message <?> message , Duration messageDelayTime , String messageGroup , CompletableFuture <SendReceipt > future ) {
313
305
if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
314
- log .error ("send request message failed. destination:{}, message is null " , destination );
315
306
throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
316
307
}
317
308
Producer grpcProducer = this .getProducer ();
@@ -329,7 +320,6 @@ public CompletableFuture<SendReceipt> asyncSend(String destination, Message<?> m
329
320
});
330
321
}
331
322
} catch (Exception e ) {
332
- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
333
323
throw new MessagingException (e .getMessage (), e );
334
324
}
335
325
return future0 ;
@@ -358,7 +348,6 @@ public Pair<SendReceipt, Transaction> sendMessageInTransaction(String destinatio
358
348
*/
359
349
public Pair <SendReceipt , Transaction > sendTransactionMessage (String destination , Message <?> message ) {
360
350
if (Objects .isNull (message ) || Objects .isNull (message .getPayload ())) {
361
- log .error ("send request message failed. destination:{}, message is null " , destination );
362
351
throw new IllegalArgumentException ("`message` and `message.payload` cannot be null" );
363
352
}
364
353
final SendReceipt sendReceipt ;
@@ -368,9 +357,7 @@ public Pair<SendReceipt, Transaction> sendTransactionMessage(String destination,
368
357
try {
369
358
transaction = grpcProducer .beginTransaction ();
370
359
sendReceipt = grpcProducer .send (rocketMsg , transaction );
371
- log .info ("Send transaction message successfully, messageId={}" , sendReceipt .getMessageId ());
372
360
} catch (ClientException e ) {
373
- log .error ("send request message failed. destination:{}, message:{} " , destination , message );
374
361
throw new RuntimeException (e );
375
362
}
376
363
return new Pair <>(sendReceipt , transaction );
0 commit comments