Seata recent study reported the error when no available service 'null' found, please make sure registry config correct, the service name in the configuration file there, no way can only be with the source code
环境springcloud Hoxton.SR3 +Springboot 2.2.5.RELEASE+seata1.1+nacos1.4
seata package download is too slow, the direct use of compiler version 1.2-SNAPSHOT
I encountered this problem for two reasons.
1. There is no use to configure official website, directly take someone else's profile import
2. No dependence caused by the introduction of
Let's look at the reasons
Error source seata1.0
io.seata.core.rpc.netty.NettyClientChannelManager#reconnect
void reconnect(String transactionServiceGroup) { List<String> availList = null; try { availList = getAvailServerList(transactionServiceGroup); } catch (Exception e) { LOGGER.error("Failed to get available servers: {}", e.getMessage(), e); return; } if (CollectionUtils.isEmpty(availList)) { String serviceGroup = RegistryFactory.getInstance() .getServiceGroup(transactionServiceGroup); LOGGER.error("no available service '{}' found, please make sure registry config correct", serviceGroup); return; } for (String serverAddress : availList) { try { acquireChannel(serverAddress); } catch (Exception e) { LOGGER.error("{} can not connect to {} cause:{}",FrameworkErrorCode.NetConnect.getErrCode(), serverAddress, e.getMessage(), e); } } }
io.seata.discovery.registry.RegistryService#getServiceGroup
String PREFIX_SERVICE_MAPPING = "vgroup_mapping.";
/**
* The constant PREFIX_SERVICE_ROOT.
*/
String PREFIX_SERVICE_ROOT = "service";
/**
* The constant CONFIG_SPLIT_CHAR.
*/
String CONFIG_SPLIT_CHAR = ".";
default String getServiceGroup(String key) {
Configuration config = ConfigurationFactory.getInstance();
return config.getConfig(PREFIX_SERVICE_ROOT + CONFIG_SPLIT_CHAR + PREFIX_SERVICE_MAPPING + key);
}
Above the red part is the root cause, after version 1.1
vgroup_mapping into vgroupMapping the
so everyone in the seata imported configuration directly modify the source code to find a good profile import under the following script directory, nacos-config.txt before after 1.1 also removed nacos
nacos-config.sh above nacos directory
So if you use version 1.1 or more seata remember to use the group name
vgroupMapping, and before 1.0 with vgroup_mapping, remember that all of this must be changed together contain Oh,
another reason is that you do not block the introduction of spring-cloud-alibaba-seata dependent arising
Interested students are welcome to join together to learn 513 650 703