XiaoyiPeng opened a new issue #4060:
URL: https://github.com/apache/rocketmq/issues/4060


   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   When I send messages using `TransactionMQProducer`, I encounter a 
`java.lang.IllegalStateException` which is not in the list of exception 
declarations in the send method signature  
   ```java
   DefaultMQProducer#send(Message msg) 
              throws MQClientException, RemotingException, 
              MQBrokerException, InterruptedException
   ``` 
   as below shown: 
   
   
![image](https://user-images.githubusercontent.com/8653312/160734718-0022c8c4-7e55-4e76-8e68-cdfe99c5c9d1.png)
   
   It's due to method `MQClientInstance#updateTopicRouteInfoFromNameServer`, 
when it catch `RemotingException`, a `IllegalStateException` is rethowed.
   
   as shown below:
   
   
![image](https://user-images.githubusercontent.com/8653312/160735411-31440412-8163-4890-8c76-1c0e33a1e4e7.png)
   
   It would be better to throw the caught `RemotingException` here.
   
   In addition, many methods in **client API** , if they interact with the 
broker side, It would be better to declaring `RemotingException` in their 
method signatures, eg: 
   
   ```java
   long maxOffset(final MessageQueue mq) throws MQClientException;
   ```
   
   2. Please tell us about your environment:
   
       OS:Windows10
       branch: develop
   
   3. Other information (e.g. detailed explanation, logs, related issues, 
suggestions on how to fix, etc):
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to