Your Alibaba Cloud ECS instance and the MQ broker are not in the same region.
You may have accessed the MQ service on a non-Alibaba Cloud ECS instance, and the topic you created does not support access by non-Alibaba Cloud ECS instances.
Perform the following steps:
Ensure that the ECS instance and the topic are in the same region.
If you access MQ on non-Alibaba Cloud ECS instances, make sure that the region of the topic is Internet.