{"record":{"id":"34621f9f7293627a","repo":"apache/shenyu","slug":"the-current-provider-is-of-orderly-type-please-use","errorCode":null,"errorMessage":"The current provider is  of orderly type. Please use onOrderlyData() method.","messagePattern":"The current provider is  of orderly type\\. Please use onOrderlyData\\(\\) method\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java","lineNumber":84,"sourceCode":"     * @param disruptor  the disruptor\n     * @param isOrderly  the orderly Whether to execute sequentially.\n     * @param executor   the executor service to be managed\n     */\n    public DisruptorProvider(final RingBuffer<DataEvent<T>> ringBuffer, final Disruptor<DataEvent<T>> disruptor, final boolean isOrderly, final ExecutorService executor) {\n        this.ringBuffer = ringBuffer;\n        this.disruptor = disruptor;\n        this.isOrderly = isOrderly;\n        this.executor = executor;\n    }\n\n    /**\n     * Send a data.\n     *\n     * @param data the data\n     */\n    public void onData(final T data) {\n        if (isOrderly) {\n            throw new IllegalArgumentException(\"The current provider is  of orderly type. Please use onOrderlyData() method.\");\n        }\n        try {\n            ringBuffer.publishEvent(translatorOneArg, data);\n        } catch (Exception ex) {\n            logger.error(\"ex\", ex);\n        }\n    }\n    \n    /**\n     * On orderly data.\n     *\n     * @param data      the data\n     * @param hashArray the hashArray.\n     */\n    public void onOrderlyData(final T data, final String... hashArray) {\n        if (!this.isOrderly) {\n            throw new IllegalArgumentException(\"The current provider is not of orderly type. Please use onData() method.\");\n        }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java#L66-L102","documentation":"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().","triggerScenarios":"Calling DisruptorProvider.onData(data) on a provider built with DisruptorProviderManage/provider.ofOrderly(true) (isOrderly == true).","commonSituations":"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().","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"],"exampleFix":"// before\nprovider.onData(data);\n// after\nprovider.onOrderlyData(data, \"myHashKey\");","handlingStrategy":"type-guard","validationCode":"// guard before publishing\nif (provider.isOrderly()) {\n    provider.onOrderlyData(data, hashKey);\n} else {\n    provider.onData(data);\n}","typeGuard":"boolean useOrderlyPath = provider.isOrderly(); // prefer exposing/checking the flag before choosing the publish method","tryCatchPattern":"try {\n    provider.onData(data);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"of orderly type\")) {\n        provider.onOrderlyData(data, hashKey);\n    } else {\n        throw e;\n    }\n}","preventionTips":["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"],"tags":["disruptor","illegal-argument","ordering","api-misuse"],"backgroundTag":"unsupported-operation","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}