Netflix/Hystrix · error · RuntimeException
unsupported execution type: {}
Error message
unsupported execution type: {} What it means
CommandExecutor.execute dispatches on ExecutionType (SYNCHRONOUS, ASYNCHRONOUS, OBSERVABLE) derived from the method's return type; any other/null value falls to the default branch and throws RuntimeException. In practice this signals an internal inconsistency — the execution type computed by MetaHolder did not match one of the known enum constants — rather than a normal user configuration error.
Source
Thrown at hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/command/CommandExecutor.java:67
switch (executionType) {
case SYNCHRONOUS: {
return castToExecutable(invokable, executionType).execute();
}
case ASYNCHRONOUS: {
HystrixExecutable executable = castToExecutable(invokable, executionType);
if (metaHolder.hasFallbackMethodCommand()
&& ExecutionType.ASYNCHRONOUS == metaHolder.getFallbackExecutionType()) {
return new FutureDecorator(executable.queue());
}
return executable.queue();
}
case OBSERVABLE: {
HystrixObservable observable = castToObservable(invokable);
return ObservableExecutionMode.EAGER == metaHolder.getObservableExecutionMode() ? observable.observe() : observable.toObservable();
}
default:
throw new RuntimeException("unsupported execution type: " + executionType);
}
}
private static HystrixExecutable castToExecutable(HystrixInvokable invokable, ExecutionType executionType) {
if (invokable instanceof HystrixExecutable) {
return (HystrixExecutable) invokable;
}
throw new RuntimeException("Command should implement " + HystrixExecutable.class.getCanonicalName() + " interface to execute in: " + executionType + " mode");
}
private static HystrixObservable castToObservable(HystrixInvokable invokable) {
if (invokable instanceof HystrixObservable) {
return (HystrixObservable) invokable;
}
throw new RuntimeException("Command should implement " + HystrixObservable.class.getCanonicalName() + " interface to execute in observable mode");
}
}View on GitHub (pinned to 5ce3bc58c3)
Solutions
- Align hystrix-javanica, hystrix-core (and hystrix-metrics-event-stream etc.) to the same released 1.5.x version — check for duplicates with 'mvn dependency:tree | grep hystrix'.
- Exclude transitively pulled older/newer javanica jars from other dependencies.
- If you extend MetaHolderFactory or CommandExecutor, ensure the produced executionType is one of the three enum constants for every annotated signature.
Example fix
<!-- before: mixed versions --> <dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-javanica</artifactId><version>1.5.8</version></dependency> <dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-core</artifactId><version>1.5.18</version></dependency> <!-- after: aligned --> <dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-javanica</artifactId><version>1.5.18</version></dependency> <dependency><groupId>com.netflix.hystrix</groupId><artifactId>hystrix-core</artifactId><version>1.5.18</version></dependency>
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify a single javanica version on classpath at build time: // mvn dependency:tree -Dincludes=com.netflix.hystrix -> expect one hystrix-javanica and one hystrix-core version
Try / catch
try { CommandExecutor.execute(invokable, executionType, metaHolder); } catch (RuntimeException e) { if ("unsupported execution type".equals(prefix(e))) { log.error("hystrix version/extension mismatch — audit dependency tree and custom factories"); } throw e; } Prevention
- Pin all com.netflix.hystrix artifacts to one version via dependencyManagement; run dependency:tree in CI to catch duplicates.
- If you fork/extend javanica internals, add tests covering all three ExecutionType paths.
When it happens
Trigger: metaHolder.getExecutionType() (or collapserExecutionType) returning null or an unexpected value, e.g. after mixing incompatible hystrix-javanica and hystrix-core versions where ExecutionType semantics diverged, or a custom MetaHolderFactory/extension returning a bad type.
Common situations: Version skew between hystrix-contrib/hystrix-javanica and hystrix-core artifacts on the classpath; custom forks or shaded copies of javanica classes; collapser whose execution-type resolution was customized.
Related errors
- Command should implement {} interface to execute in: {} mode
- Command should implement {} interface to execute in observab
- method cannot be annotated with HystrixCommand and HystrixCo
- Collapser method must have one argument: {}
- batch method is absent: {}
AI-assisted analysis of Netflix/Hystrix@5ce3bc58c3 (2026-08-14).
Data as JSON: /api/errors/2336261948079036.
Report an issue: GitHub.