{"record":{"id":"09bbee476078eae1","repo":"apache/shenyu","slug":"the-current-provider-is-not-of-orderly-type-please-use","errorCode":null,"errorMessage":"The current provider is not of orderly type. Please use onData() method.","messagePattern":"The current provider is not of orderly type\\. Please use onData\\(\\) method\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java","lineNumber":101,"sourceCode":"        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        }\n        try {\n            String hash = String.join(\":\", hashArray);\n            ringBuffer.publishEvent(orderlyArg, data, hash);\n        } catch (Exception ex) {\n            logger.error(\"ex\", ex);\n        }\n    }\n    \n    /**\n     * Shutdown.\n     */\n    public void shutdown() {\n        if (Objects.nonNull(disruptor)) {\n            disruptor.shutdown();\n        }\n        if (Objects.nonNull(executor)) {\n            executor.shutdown();","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/provider/DisruptorProvider.java#L83-L119","documentation":"DisruptorProvider.onOrderlyData() publishes data with an ordering hash so entries with the same hash are consumed sequentially. It is only valid on providers created with orderly=true; otherwise this IllegalArgumentException is thrown and the caller should use onData().","triggerScenarios":"Calling onOrderlyData(data, hashArray) on a provider whose isOrderly flag is false (default, unordered creation).","commonSituations":"Copying orderly publish code into a module that created its provider with DisruptorProvider.ofType(..., false) or the default unordered constructor; refactoring that flipped a provider to unordered but left orderly call sites.","solutions":["Switch the call site to onData(data)","If ordering is required, recreate the provider as orderly (ofOrderly(true) / correct DisruptorProviderManage configuration)","Audit all publish call sites of the provider to match its configured mode"],"exampleFix":"// before\nprovider.onOrderlyData(data, \"key\");\n// after\nprovider.onData(data);","handlingStrategy":"type-guard","validationCode":"// guard before publishing\nif (provider.isOrderly()) {\n    provider.onOrderlyData(data, hashKey);\n} else {\n    provider.onData(data);\n}","typeGuard":"boolean canUseOrderly = provider.isOrderly();","tryCatchPattern":"try {\n    provider.onOrderlyData(data, hashKey);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"not of orderly type\")) {\n        provider.onData(data);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Match provider construction (ofOrderly) with every publish call site","Document required ordering per disruptor pipeline in the module README","Add tests that exercise the publish path of each provider configuration"],"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"}