You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/21 17:14:47 UTC

[GitHub] [rocketmq] tsunghanjacktsai commented on a diff in pull request #4354: [ISSUE #4323] Transaction example add the default NamesrvAddr

tsunghanjacktsai commented on code in PR #4354:
URL: https://github.com/apache/rocketmq/pull/4354#discussion_r878739969


##########
example/src/main/java/org/apache/rocketmq/example/transaction/TransactionProducer.java:
##########
@@ -26,32 +26,38 @@
 import java.io.UnsupportedEncodingException;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 public class TransactionProducer {
+
+    public static final String PRODUCER_GROUP = "please_rename_unique_group_name";
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "TopicTest1234";
+
+    public static final int MESSAGE_COUNT = 10;
+
     public static void main(String[] args) throws MQClientException, InterruptedException {
         TransactionListener transactionListener = new TransactionListenerImpl();
-        TransactionMQProducer producer = new TransactionMQProducer("please_rename_unique_group_name");
-        ExecutorService executorService = new ThreadPoolExecutor(2, 5, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(2000), new ThreadFactory() {
-            @Override
-            public Thread newThread(Runnable r) {
-                Thread thread = new Thread(r);
-                thread.setName("client-transaction-msg-check-thread");
-                return thread;
-            }
+        TransactionMQProducer producer = new TransactionMQProducer(PRODUCER_GROUP);
+
+        // If the debugging source code can open comments, you need to set the namesrvAddr to the address of the local namesrvAddr

Review Comment:
   Hi, LGTM overall. Maybe you could try to rephrase this instruction into "Uncomment the following line while debugging, namesrvAddr should be set to your local address".



-- 
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: dev-unsubscribe@rocketmq.apache.org

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