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 2021/08/25 12:27:27 UTC

[GitHub] [rocketmq] KevinBlandy opened a new issue #3293: How should I test if the connection is available?

KevinBlandy opened a new issue #3293:
URL: https://github.com/apache/rocketmq/issues/3293


   
   
   I want to determine at the beginning of the program whether the MQ service is working or not.
   
   I constructed an error address message and called the `start()` method, but no exception was thrown and there was no hint. Everything seems to be fine.
   
   ```java
   import org.apache.rocketmq.client.exception.MQClientException;
   import org.apache.rocketmq.client.producer.DefaultMQProducer;
   
   public class MQTest {
   	
   	public static void main(String[] args) throws MQClientException {
   		
   		DefaultMQProducer producer = new DefaultMQProducer("default");
   		producer.setNamesrvAddr("undefinde:-1");
   		
   		producer.start();		
   		
   	}
   }
   
   ```
   
   I didn't find any other methods like `ping()`, `createConn()` either.
   
   The current solution is to try to send a message to a Topic that does not exist and then determine if the service is available based on the exception message.
   
   But this doesn't seem elegant enough, is there a good solution?
   
   


-- 
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



[GitHub] [rocketmq] coder-zzzz commented on issue #3293: How should I test if the connection is available?

Posted by GitBox <gi...@apache.org>.
coder-zzzz commented on issue #3293:
URL: https://github.com/apache/rocketmq/issues/3293#issuecomment-906212164


   or you can use -Drocketmq.client.logRoot to change the default client log dir


-- 
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



[GitHub] [rocketmq] vongosling closed issue #3293: How should I test if the connection is available?

Posted by GitBox <gi...@apache.org>.
vongosling closed issue #3293:
URL: https://github.com/apache/rocketmq/issues/3293


   


-- 
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



[GitHub] [rocketmq] maixiaohai commented on issue #3293: How should I test if the connection is available?

Posted by GitBox <gi...@apache.org>.
maixiaohai commented on issue #3293:
URL: https://github.com/apache/rocketmq/issues/3293#issuecomment-905479647


   you can check the client log at dir `~/logs/rocketmqlogs/rocketmq_client.log`


-- 
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