apache/shenyu · error · IllegalArgumentException
The current provider is of orderly type. Please use…
Error message
The current provider is of orderly type. Please use onOrderlyData() method.
What it means
DisruptorProvider.onData() is the non-ordered publish path of the LMAX Disruptor wrapper. When the provider was created with orderly=true, calling onData() is a programming error — the class throws IllegalArgumentException so the caller switches to onOrderlyData().
Solutions
- Change the call site to onOrderlyData(data, hash...) supplying the ordering hash keys
- If ordering is not actually needed, build the provider with orderly=false and keep onData()
- Check the provider construction site (DisruptorProviderManage.getProvider / ofOrderly) to confirm which mode is active
Example fix
// before provider.onData(data); // after provider.onOrderlyData(data, "myHashKey");
Defensive patterns
Strategy: type-guard
Validate before calling
// guard before publishing
if (provider.isOrderly()) {
provider.onOrderlyData(data, hashKey);
} else {
provider.onData(data);
} Type guard
boolean useOrderlyPath = provider.isOrderly(); // prefer exposing/checking the flag before choosing the publish method
Try / catch
try {
provider.onData(data);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("of orderly type")) {
provider.onOrderlyData(data, hashKey);
} else {
throw e;
}
} Prevention
- Keep publish call sites next to provider construction so mode and method stay in sync
- Name variables to encode the mode (orderlyProvider vs plainProvider)
- Add unit tests asserting the correct publish method per provider mode
- Prefer DisruptorProviderManage factory methods that return a mode-typed wrapper
When it happens
Trigger: Calling DisruptorProvider.onData(data) on a provider built with DisruptorProviderManage/provider.ofOrderly(true) (isOrderly == true).
Common situations: Registering a consumer with an orderly provider (e.g. the admin register-center disruptor pipeline for metadata/URI registration that requires per-hash ordering) but reusing generic publish code that calls onData().
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- The current provider is not of orderly type. Please use…
- @ShenyuClient please use it on the interface.
- extension clazz (clazz) is not interface!
AI-assisted analysis of apache/shenyu@567142e072 (2026-09-12).
Data as JSON: /api/errors/34621f9f7293627a.
Report an issue: GitHub.
Appendix: source
Thrown at shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java:84
* @param disruptor the disruptor
* @param isOrderly the orderly Whether to execute sequentially.
* @param executor the executor service to be managed
*/
public DisruptorProvider(final RingBuffer<DataEvent<T>> ringBuffer, final Disruptor<DataEvent<T>> disruptor, final boolean isOrderly, final ExecutorService executor) {
this.ringBuffer = ringBuffer;
this.disruptor = disruptor;
this.isOrderly = isOrderly;
this.executor = executor;
}
/**
* Send a data.
*
* @param data the data
*/
public void onData(final T data) {
if (isOrderly) {
throw new IllegalArgumentException("The current provider is of orderly type. Please use onOrderlyData() method.");
}
try {
ringBuffer.publishEvent(translatorOneArg, data);
} catch (Exception ex) {
logger.error("ex", ex);
}
}
/**
* On orderly data.
*
* @param data the data
* @param hashArray the hashArray.
*/
public void onOrderlyData(final T data, final String... hashArray) {
if (!this.isOrderly) {
throw new IllegalArgumentException("The current provider is not of orderly type. Please use onData() method.");
}View on GitHub (pinned to 567142e072)