apache/incubator-seata · warning · NotSupportYetException
not support atomic operation putConfigIfAbsent
Error message
not support atomic operation putConfigIfAbsent
What it means
ApolloConfiguration.putConfigIfAbsent throws NotSupportYetException('not support atomic operation putConfigIfAbsent'). Atomic check-and-set publish is not implemented because Apollo's client API used by seata exposes no atomic putIfAbsent; Apollo namespaces are edited via its portal. The exception makes the missing capability explicit rather than faking it with a non-atomic sequence.
Source
Thrown at config/seata-config-apollo/src/main/java/org/apache/seata/config/apollo/ApolloConfiguration.java:142
@Override
public String getLatestConfig(String dataId, String defaultValue, long timeoutMills) {
ConfigFuture configFuture =
new ConfigFuture(dataId, defaultValue, ConfigFuture.ConfigOperation.GET, timeoutMills);
configOperateExecutor.submit(() -> {
String result = config.getProperty(dataId, defaultValue);
configFuture.setResult(result);
});
return (String) configFuture.get();
}
@Override
public boolean putConfig(String dataId, String content, long timeoutMills) {
throw new NotSupportYetException("not support putConfig");
}
@Override
public boolean putConfigIfAbsent(String dataId, String content, long timeoutMills) {
throw new NotSupportYetException("not support atomic operation putConfigIfAbsent");
}
@Override
public boolean removeConfig(String dataId, long timeoutMills) {
throw new NotSupportYetException("not support removeConfig");
}
@Override
public void addConfigListener(String dataId, ConfigurationChangeListener listener) {
if (StringUtils.isBlank(dataId) || listener == null) {
return;
}
LISTENER_SERVICE_MAP
.computeIfAbsent(dataId, key -> ConcurrentHashMap.newKeySet())
.add(listener);
}
@OverrideView on GitHub (pinned to e01f97c6db)
Solutions
- Pre-create the config keys in Apollo via portal/OpenAPI before starting seata.
- Guard the call with a check of getTypeName()/backend capability before invoking putConfigIfAbsent.
- Switch to nacos/consul/etcd3 if atomic publish is required at runtime.
- Catch NotSupportYetException where the write is best-effort.
Example fix
// before
boolean created = configuration.putConfigIfAbsent(dataId, content, timeoutMills);
// after
boolean created;
try {
created = configuration.putConfigIfAbsent(dataId, content, timeoutMills);
} catch (NotSupportYetException e) {
LOGGER.warn("putConfigIfAbsent unsupported on apollo; pre-create {} in the Apollo portal", dataId);
created = false;
} Defensive patterns
Strategy: try-catch
Validate before calling
"apollo".equals(configuration.getTypeName()) // avoid putConfigIfAbsent on read-only backends
Try / catch
try {
configuration.putConfigIfAbsent(dataId, content, timeoutMills);
} catch (NotSupportYetException e) {
LOGGER.warn("atomic put unsupported on {}; pre-create the key out-of-band", configuration.getTypeName());
} Prevention
- Pre-seed required keys in Apollo before application startup
- Treat putConfigIfAbsent as optional capability, not a contract, in bootstrap code
When it happens
Trigger: Calling putConfigIfAbsent on a Configuration whose type is apollo — typically initialization code that tries to register default config values if absent (works on Nacos, throws here).
Common situations: Porting bootstrap/init logic from Nacos-backed seata to Apollo; shared config- provisioning utilities assuming all backends support CAS writes.
Related errors
- not support putConfig
- not support removeConfig
- Apollo configuration initialized failed,please check the val
- not support method:%s
- ERR_CONFIG
AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14).
Data as JSON: /api/errors/ff543d712a75aca4.
Report an issue: GitHub.