duhengforever commented on a change in pull request #358: [ISSUE #292] Add 
support of transactional message feature 
URL: https://github.com/apache/rocketmq/pull/358#discussion_r202054665
 
 

 ##########
 File path: 
broker/src/main/java/org/apache/rocketmq/broker/client/net/Broker2Client.java
 ##########
 @@ -62,34 +60,22 @@ public Broker2Client(BrokerController brokerController) {
     }
 
     public void checkProducerTransactionState(
+        final String group,
         final Channel channel,
         final CheckTransactionStateRequestHeader requestHeader,
-        final SelectMappedBufferResult selectMappedBufferResult) {
+        final MessageExt messageExt) throws Exception {
         RemotingCommand request =
             
RemotingCommand.createRequestCommand(RequestCode.CHECK_TRANSACTION_STATE, 
requestHeader);
-        request.markOnewayRPC();
-
+        request.setBody(MessageDecoder.encode(messageExt, false));
         try {
-            FileRegion fileRegion =
-                new 
OneMessageTransfer(request.encodeHeader(selectMappedBufferResult.getSize()),
-                    selectMappedBufferResult);
-            channel.writeAndFlush(fileRegion).addListener(new 
ChannelFutureListener() {
-                @Override
-                public void operationComplete(ChannelFuture future) throws 
Exception {
-                    selectMappedBufferResult.release();
-                    if (!future.isSuccess()) {
-                        log.error("invokeProducer failed,", future.cause());
-                    }
-                }
-            });
-        } catch (Throwable e) {
-            log.error("invokeProducer exception", e);
-            selectMappedBufferResult.release();
+            this.brokerController.getRemotingServer().invokeOneway(channel, 
request, 10);
 
 Review comment:
   This is an empirical value when using the invokeOneWay method. In the check 
scenario , we don't need to wait for the producer‘s response, and in order to 
prevent too many threads waiting,we adopted this configuration,but  we also 
considered that whether it is necessary to make this parameter 
configurable,what’s your opinion?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to