quarkusio/quarkus · error · RuntimeException

knative-events.function-mapping does not map to a function:

Error message

knative-events.function-mapping does not map to a function: ${functionName}

What it means

At startup, the Funqy Knative Events binding recorder validates every entry in quarkus.funqy.knative-events.function-mapping against the registry of @Funq functions built at build time. If a mapping key does not name a registered function, FunctionRecorder.registry.matchInvoker() returns null and a RuntimeException is thrown. This fails the application start so a broken mapping is caught immediately rather than at first request.

Source

Thrown at extensions/funqy/funqy-knative-events/runtime/src/main/java/io/quarkus/funqy/runtime/bindings/knative/events/KnativeEventsBindingRecorder.java:222

        // This needs to happen in start at RUNTIME so that
        // mappings can be overridden by environment variables
        FunctionInvoker defaultInvoker = null;
        if (runtimeConfig.getValue().export().isPresent()) {
            defaultInvoker = FunctionRecorder.registry.matchInvoker(runtimeConfig.getValue().export().get());
            if (defaultInvoker == null) {
                throw new RuntimeException(
                        "quarkus.funqy.export value does not map a function: " + runtimeConfig.getValue().export().get());
            }

        }

        if (eventsRuntimeConfig.getValue().mapping() != null) {
            for (Map.Entry<String, FunqyKnativeEventsConfig.FunctionMapping> entry : eventsRuntimeConfig.getValue().mapping()
                    .entrySet()) {
                String functionName = entry.getKey();
                FunctionInvoker invoker = FunctionRecorder.registry.matchInvoker(functionName);
                if (invoker == null) {
                    throw new RuntimeException("knative-events.function-mapping does not map to a function: " + functionName);
                }
                FunqyKnativeEventsConfig.FunctionMapping mapping = entry.getValue();
                if (mapping.trigger().isPresent()) {
                    typeTriggers.compute(mapping.trigger().get(), (k, v) -> {
                        if (v == null) {
                            v = new ArrayList<>();
                        }
                        v.add(invoker);
                        return v;
                    });
                }
                if (invoker.hasOutput()) {
                    if (mapping.responseSource().isPresent()) {
                        invoker.getBindingContext().put(RESPONSE_SOURCE, mapping.responseSource().get());
                    }
                    if (mapping.responseType().isPresent()) {
                        invoker.getBindingContext().put(RESPONSE_TYPE, mapping.responseType().get());
                    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Open application.properties and check every key under quarkus.funqy.knative-events.function-mapping; each key must exactly match a registered Funqy function name
  2. Set the function's name explicitly with @Funq("name") if the method name differs from the mapping key
  3. Remove or correct stale mapping entries left from deleted or renamed functions
  4. Enable Funqy logging or inspect the build-time function registry to list valid function names

Example fix

// before (application.properties)
quarkus.funqy.knative-events.function-mapping."processOrder".trigger-type=my.trigger
// after (function renamed to handleOrder)
quarkus.funqy.knative-events.function-mapping."handleOrder".trigger-type=my.trigger
Defensive patterns

Strategy: validation

Validate before calling

// Before startup, verify mapping keys exist in the function registry
Set<String> registered = FunctionRecorder.registry != null
    ? FunctionRecorder.registry.matchInvokerNames() : Set.of();
eventsRuntimeConfig.getValue().mapping().keySet().stream()
    .filter(k -> !registered.contains(k))
    .forEach(k -> log.warnf("Unknown knative-events function-mapping key: %s", k));

Try / catch

try {
    binder.start();
} catch (RuntimeException e) {
    if (e.getMessage().contains("function-mapping does not map to a function")) {
        log.error("Fix quarkus.funqy.knative-events.function-mapping keys to match registered @Funq functions");
    }
    throw e;
}

Prevention

When it happens

Trigger: A quarkus.funqy.knative-events.function-mapping."<name>".trigger-type (or similar) config property references a function name that has no corresponding @Funq-annotated method or has been renamed/removed.

Common situations: Renaming a @Funq method (or the function's exported name) without updating the mapping property; copy-pasting mapping config from another project; typo in the function name; removing a function but leaving stale config in application.properties or an env var override (quarkus.funqy.knative-events.function-mapping env keys).

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/ec4b1f52913bafcb. Report an issue: GitHub.