{"record":{"id":"ce6c3d5989455ad5","repo":"quarkusio/quarkus","slug":"an-event-consumer-business-method-with-two-paramet","errorCode":null,"errorMessage":"An event consumer business method with two parameters must have MultiMap as the first parameter: %s [method: %s, bean:%s]","messagePattern":"An event consumer business method with two parameters must have MultiMap as the first parameter: (.+?) \\[method: (.+?), bean:(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java","lineNumber":175,"sourceCode":"        AnnotationStore annotationStore = beanRegistrationPhase.getContext().get(BuildExtension.Key.ANNOTATION_STORE);\n        for (BeanInfo bean : beanRegistrationPhase.getContext().beans().classBeans()) {\n            for (MethodInfo method : bean.getTarget().get().asClass().methods()) {\n                if (method.isSynthetic()) {\n                    continue;\n                }\n                AnnotationInstance consumeEvent = annotationStore.getAnnotation(method, CONSUME_EVENT);\n                if (consumeEvent != null) {\n                    // Validate method params and return type\n                    int parametersCount = method.parametersCount();\n                    if (KotlinUtils.isKotlinSuspendMethod(method)) {\n                        parametersCount--;\n                    }\n\n                    List<Type> params = method.parameterTypes();\n                    if (parametersCount == 2) {\n                        if (!isMessageHeaders(params.get(0).name())) {\n                            // If there are two parameters, the first must be message headers.\n                            throw new IllegalStateException(String.format(\n                                    \"An event consumer business method with two parameters must have MultiMap as the first parameter: %s [method: %s, bean:%s]\",\n                                    params, method, bean));\n                        } else if (isMessage(params.get(1).name())) {\n                            throw new IllegalStateException(String.format(\n                                    \"An event consumer business method with two parameters must not accept io.vertx.core.eventbus.Message or io.vertx.mutiny.core.eventbus.Message: %s [method: %s, bean:%s]\",\n                                    params, method, bean));\n                        }\n                    } else if (parametersCount != 1) {\n                        throw new IllegalStateException(String.format(\n                                \"An event consumer business method must accept exactly one parameter: %s [method: %s, bean:%s]\",\n                                params, method, bean));\n                    }\n                    if (method.returnType().kind() != Kind.VOID && VertxConstants.isMessage(params.get(0).name())\n                            && !KotlinUtils.isKotlinSuspendMethod(method)) {\n                        throw new IllegalStateException(String.format(\n                                \"An event consumer business method that accepts io.vertx.core.eventbus.Message or io.vertx.mutiny.core.eventbus.Message must return void [method: %s, bean:%s]\",\n                                method, bean));\n                    }","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java#L157-L193","documentation":"VertxProcessor validates event consumer methods at build time. A @ConsumeEvent method with two parameters must declare MultiMap (headers) as its first parameter and a payload or Message as the second. If the first parameter is not MultiMap, the build fails with this IllegalStateException naming parameters, method, and bean.","triggerScenarios":"Declaring a two-parameter consumer whose first parameter is anything other than io.vertx.core.MultiMap / io.vertx.mutiny.core.MultiMap (e.g. Message first, or custom type first).","commonSituations":"Developer tries (Message, payload) ordering; confusion with other frameworks' (headers, body) conventions; signature drift after refactoring.","solutions":["Put MultiMap first: method(MultiMap headers, T payload) or method(MultiMap headers, Message<T> msg)","Reduce to a single parameter if headers are not needed","Use a single Message<T> parameter and read msg.headers() instead"],"exampleFix":"// before\n@ConsumeEvent(\"addr\")\npublic void on(Message<String> msg, String extra) { }\n// after\n@ConsumeEvent(\"addr\")\npublic void on(MultiMap headers, Message<String> msg) { }","handlingStrategy":"validation","validationCode":"// enforce (MultiMap, X) ordering for two-param consumers\nfor (Method m : MyConsumer.class.getDeclaredMethods()) {\n    if (m.isAnnotationPresent(ConsumeEvent.class) && m.getParameterCount() == 2\n        && !MultiMap.class.isAssignableFrom(m.getParameterTypes()[0])) {\n        throw new IllegalStateException(\"First parameter must be MultiMap: \" + m);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the convention: MultiMap first, payload second","Prefer single-parameter (payload or Message<T>) consumers when headers aren't needed","Add an ArchUnit/test rule for consumer signatures"],"tags":["quarkus","vertx","event-bus","method-signature","build-time"],"backgroundTag":"method-signature-invalid","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}