Because, I am making the .NET version of the SDK, and the official does not provide the .NET version of the SDK, so I can only write the SDK myself
Then, write one side of the SDK modeled after the Java version, and finally run it, and find that the error is as follows:
SDK. InvalidRegionId : Can not find endpoint to access. The current Java version certainly doesn't get an error!!!
Alibaba Cloud's official explanation is as follows:
Open API error InvalidRegionId: Can not find endpoint to access
If you call the Message Queue Open API API and get the error InvalidRegionId : Can not find endpoint to access, check whether the regionId used in the code is correct.
Note that there are two places in the code where regionId is involved.
The first place:
IClientProfile profile = DefaultProfile.getProfile(regionId, accessKey, secretKey);
The regionId here has nothing to do with the regional information of the public network/Beijing/Hangzhou to which MQ Topic belongs, it only refers to the region where the API gateway is located, and the currently supported values are cn-beijing, cn-hangzhou, cn-qingdao, cn-shenzhen, and the default is cn-hangzhou.
Second place:
request.setOnsRegionId("regionid");
The regionid here is the regional information of the public network/Beijing/Hangzhou to which MQ Topic belongs. To obtain the regionid of each region, you can call the OnsRegionList method to obtain it.
In fact, the solution is very simple, and the solution is as follows:
Tourists, if you want to see the hidden content of this post, please Reply
|