Code review comment: Before `inputCloudEvent` was initialized conditionally , if was created only if the function accepted some input, `invoker.hasInput() == true`, otherwise it was set to null in `else` branch.

Code under review:
private void processCloudEvent(RoutingContext routingContext) {
        final HttpServerRequest httpRequest = routingContext.request();
        final HttpServerResponse httpResponse = routingContext.response();
        final boolean binaryCE = httpRequest.headers().contains("ce-id");

        httpRequest.bodyHandler(bodyBuff -> executor.execute(() -> {
            try {
                final String ceType;
                final String ceSpecVersion;
                final JsonNode structuredPayload;

                if (binaryCE) {
                    ceType = httpRequest.headers().get("ce-type");
                    ceSpecVersion = httpRequest.headers().get("ce-specversion");
                    structuredPayload = null;
                } else {
                    try {
                        structuredPayload = mapper.readTree(bodyBuff.getBytes());
                        ceType = structuredPayload.get("type").asText();
                        ceSpecVersion = structuredPayload.get("specversion").asText();
                    } catch (IOException e) {
                        routingContext.fail(e);
                        return;
                    }
                }

                if (!isKnownSpecVersion(ceSpecVersion)) {
                    log.warnf("Unexpected CloudEvent spec-version '%s'.", ceSpecVersion);
                }

                Collection<FunctionInvoker> candidates = new ArrayList<>();
                if (defaultInvoker != null) {
                    candidates.add(defaultInvoker);
                } else {
                    candidates = typeTriggers.get(ceType);

                    if (candidates == null || candidates.isEmpty()) {
                        routingContext.fail(404);
                        log.error("Couldn't map CloudEvent type: '" + ceType + "' to a function.");
                        return;
                    }
                }

                final CloudEvent<?> evt;
                if (binaryCE) {
                    evt = new HeaderCloudEventImpl<>(
                            httpRequest.headers(),
                            null,
                            null,
                            null,
                            null);
                } else {
                    evt = new JsonCloudEventImpl<>(
                            structuredPayload,
                            null,
                            null,
                            null);
                }
                List<FunctionInvoker> matchingCandidates = candidates
                        .stream()
                        .filter(fi -> match(fi, evt))
                        .collect(Collectors.toList());

                if (matchingCandidates.size() <= 0) {
                    routingContext.fail(404);
                    log.error("Couldn't map CloudEvent type: '" + ceType + "' to any function.");
                    return;
                }
                if (matchingCandidates.size() > 1) {
                    routingContext.fail(409);
                    log.error("CloudEvent type: '" + ceType + "' matches multiple function.");
                    return;
                }

                final FunctionInvoker invoker = matchingCandidates.get(0);

                final Type inputCeDataType = (Type) invoker.getBindingContext().get(INPUT_CE_DATA_TYPE);
                final Type outputCeDataType = (Type) invoker.getBindingContext().get(OUTPUT_CE_DATA_TYPE);
                final Type innerInputType = inputCeDataType != null ? inputCeDataType : invoker.getInputType();
                final Type innerOutputType = outputCeDataType != null ? outputCeDataType : invoker.getOutputType();
                final ObjectReader reader = (ObjectReader) invoker.getBindingContext().get(DATA_OBJECT_READER);
                final ObjectWriter writer = (ObjectWriter) invoker.getBindingContext().get(DATA_OBJECT_WRITER);

                final CloudEvent<?> inputCloudEvent;
                if (binaryCE) {
                    inputCloudEvent = new HeaderCloudEventImpl<>(
                            httpRequest.headers(),
                            bodyBuff,
                            inputCeDataType != null ? inputCeDataType : innerInputType,
                            mapper,
                            reader);
                } else {
                    inputCloudEvent = new JsonCloudEventImpl<>(
                            structuredPayload,
                            inputCeDataType != null ? inputCeDataType : innerInputType,
                            mapper,
                            reader);
                }

                final Object input;
                if (invoker.hasInput()) {
                    if (inputCeDataType == null) {
                        
                        input = inputCloudEvent.data();
                    } else {
                        
                        input = inputCloudEvent;
                    }
                } else {
                    input = null;
                }

                final Consumer<Object> sendOutput = output -> {
                    try {
                        if (!invoker.hasOutput()) {
                            routingContext.response().setStatusCode(204);
                            routingContext.response().end();
                            return;
                        }

                        final CloudEvent<?> outputCloudEvent;
                        if (outputCeDataType == null) {
                            
                            CloudEventBuilder builder = CloudEventBuilder.create();
                            if (byte[].class.equals(innerOutputType)) {
                                outputCloudEvent = builder.build((byte[]) output, "application/octet-stream");
                            } else {
                                outputCloudEvent = builder.build(output);
                            }
                        } else {
                            
                            outputCloudEvent = (CloudEvent<?>) output;
                        }

                        String id = outputCloudEvent.id();
                        if (id == null) {
                            id = getResponseId();
                        }
                        String specVersion;
                        if (outputCloudEvent.specVersion() != null) {
                            specVersion = outputCloudEvent.specVersion();
                        } else if (inputCloudEvent.specVersion() != null) {
                            specVersion = inputCloudEvent.specVersion();
                        } else {
                            specVersion = "1.0";
                        }
                        String source = outputCloudEvent.source();
                        if (source == null) {
                            source = (String) invoker.getBindingContext().get(RESPONSE_SOURCE);
                        }
                        String type = outputCloudEvent.type();
                        if (type == null) {
                            type = (String) invoker.getBindingContext().get(RESPONSE_TYPE);
                        }

                        boolean ceHasData = !Void.class.equals(innerInputType);

                        int majorSpecVer = parseMajorSpecVersion(specVersion);

                        if (binaryCE) {
                            httpResponse.putHeader("ce-id", id);
                            httpResponse.putHeader("ce-specversion", specVersion);
                            httpResponse.putHeader("ce-source", source);
                            httpResponse.putHeader("ce-type", type);

                            if (outputCloudEvent.time() != null) {
                                httpResponse.putHeader("ce-time", outputCloudEvent.time().toString());
                            }

                            if (outputCloudEvent.subject() != null) {
                                httpResponse.putHeader("ce-subject", outputCloudEvent.subject());
                            }

                            if (outputCloudEvent.dataSchema() != null) {
                                String dsName = majorSpecVer == 0 ? "ce-schemaurl" : "ce-dataschema";
                                httpResponse.putHeader(dsName, outputCloudEvent.dataSchema());
                            }

                            outputCloudEvent.extensions()
                                    .entrySet()
                                    .forEach(e -> httpResponse.putHeader("ce-" + e.getKey(), e.getValue()));

                            String dataContentType = outputCloudEvent.dataContentType();
                            if (dataContentType != null) {
                                httpResponse.putHeader("Content-Type", dataContentType);
                            }

                            if (ceHasData) {
                                if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                    httpResponse.end(Buffer.buffer(writer.writeValueAsBytes(outputCloudEvent.data())));
                                } else if (byte[].class.equals(innerOutputType)) {
                                    httpResponse.end(Buffer.buffer((byte[]) outputCloudEvent.data()));
                                } else {
                                    log.errorf("Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                            dataContentType, innerOutputType);
                                    routingContext.fail(500);
                                    return;
                                }
                            } else {
                                routingContext.response().setStatusCode(204);
                                routingContext.response().end();
                            }
                            return;
                        } else {
                            final Map<String, Object> responseEvent = new HashMap<>();
                            responseEvent.put("id", id);
                            responseEvent.put("specversion", specVersion);
                            responseEvent.put("source", source);
                            responseEvent.put("type", type);

                            if (outputCloudEvent.time() != null) {
                                responseEvent.put("time", outputCloudEvent.time());
                            }

                            if (outputCloudEvent.subject() != null) {
                                responseEvent.put("subject", outputCloudEvent.subject());
                            }

                            if (outputCloudEvent.dataSchema() != null) {
                                String dsName = majorSpecVer == 0 ? "schemaurl" : "dataschema";
                                responseEvent.put(dsName, outputCloudEvent.dataSchema());
                            }

                            outputCloudEvent.extensions()
                                    .entrySet()
                                    .forEach(e -> responseEvent.put(e.getKey(), e.getValue()));

                            String dataContentType = outputCloudEvent.dataContentType();
                            if (dataContentType != null) {
                                responseEvent.put("datacontenttype", dataContentType);
                            }

                            if (ceHasData) {
                                if (majorSpecVer == 0) {
                                    if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                        responseEvent.put("data", outputCloudEvent.data());
                                    } else if (byte[].class.equals(innerOutputType)) {
                                        responseEvent.put("datacontentencoding", "base64");
                                        responseEvent.put("data", (byte[]) outputCloudEvent.data());
                                    } else {
                                        log.errorf(
                                                "Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                                dataContentType, innerOutputType);
                                        routingContext.fail(500);
                                        return;
                                    }
                                } else {
                                    if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                        responseEvent.put("data", outputCloudEvent.data());
                                    } else if (byte[].class.equals(innerOutputType)) {
                                        responseEvent.put("data_base64", (byte[]) outputCloudEvent.data());
                                    } else {
                                        log.errorf(
                                                "Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                                dataContentType, innerOutputType);
                                        routingContext.fail(500);
                                        return;
                                    }

                                }
                            }

                            routingContext.response().putHeader("Content-Type", "application/cloudevents+json");
                            httpResponse.end(Buffer.buffer(mapper.writer().writeValueAsBytes(responseEvent)));
                            return;
                        }
                    } catch (Throwable t) {
                        routingContext.fail(t);
                    }
                };

                dispatch(inputCloudEvent, routingContext, invoker, input)
                        .getOutput()
                        .subscribe()
                        .with(sendOutput, t -> routingContext.fail(t));

            } catch (Throwable t) {
                routingContext.fail(t);
            }
        }));

    }

Line commented on: if (binaryCE) {

Revised code:
private void processCloudEvent(RoutingContext routingContext) {
        final HttpServerRequest httpRequest = routingContext.request();
        final HttpServerResponse httpResponse = routingContext.response();
        final boolean binaryCE = httpRequest.headers().contains("ce-id");

        httpRequest.bodyHandler(bodyBuff -> executor.execute(() -> {
            try {
                final String ceType;
                final String ceSpecVersion;
                final JsonNode structuredPayload;

                if (binaryCE) {
                    ceType = httpRequest.headers().get("ce-type");
                    ceSpecVersion = httpRequest.headers().get("ce-specversion");
                    structuredPayload = null;
                } else {
                    try {
                        structuredPayload = mapper.readTree(bodyBuff.getBytes());
                        ceType = structuredPayload.get("type").asText();
                        ceSpecVersion = structuredPayload.get("specversion").asText();
                    } catch (IOException e) {
                        routingContext.fail(e);
                        return;
                    }
                }

                if (!isKnownSpecVersion(ceSpecVersion)) {
                    log.warnf("Unexpected CloudEvent spec-version '%s'.", ceSpecVersion);
                }

                Collection<FunctionInvoker> candidates = new ArrayList<>();
                if (defaultInvoker != null) {
                    candidates.add(defaultInvoker);
                } else {
                    candidates = typeTriggers.get(ceType);

                    if (candidates == null || candidates.isEmpty()) {
                        routingContext.fail(404);
                        log.error("Couldn't map CloudEvent type: '" + ceType + "' to a function.");
                        return;
                    }
                }

                final CloudEvent<?> evt;
                if (binaryCE) {
                    evt = new HeaderCloudEventImpl<>(
                            httpRequest.headers(),
                            null,
                            null,
                            null,
                            null);
                } else {
                    evt = new JsonCloudEventImpl<>(
                            structuredPayload,
                            null,
                            null,
                            null);
                }
                List<FunctionInvoker> matchingCandidates = candidates
                        .stream()
                        .filter(fi -> match(fi, evt))
                        .collect(Collectors.toList());

                if (matchingCandidates.size() <= 0) {
                    routingContext.fail(404);
                    log.error("Couldn't map CloudEvent type: '" + ceType + "' to any function.");
                    return;
                }
                if (matchingCandidates.size() > 1) {
                    routingContext.fail(409);
                    log.error("CloudEvent type: '" + ceType + "' matches multiple function.");
                    return;
                }

                final FunctionInvoker invoker = matchingCandidates.get(0);

                final Type inputCeDataType = (Type) invoker.getBindingContext().get(INPUT_CE_DATA_TYPE);
                final Type outputCeDataType = (Type) invoker.getBindingContext().get(OUTPUT_CE_DATA_TYPE);
                final Type innerInputType = inputCeDataType != null ? inputCeDataType : invoker.getInputType();
                final Type innerOutputType = outputCeDataType != null ? outputCeDataType : invoker.getOutputType();
                final ObjectReader reader = (ObjectReader) invoker.getBindingContext().get(DATA_OBJECT_READER);
                final ObjectWriter writer = (ObjectWriter) invoker.getBindingContext().get(DATA_OBJECT_WRITER);

                final CloudEvent<?> inputCloudEvent;
                final Object input;
                if (invoker.hasInput()) {
                    if (binaryCE) {
                        inputCloudEvent = new HeaderCloudEventImpl<>(
                                httpRequest.headers(),
                                bodyBuff,
                                inputCeDataType != null ? inputCeDataType : innerInputType,
                                mapper,
                                reader);
                    } else {
                        inputCloudEvent = new JsonCloudEventImpl<>(
                                structuredPayload,
                                inputCeDataType != null ? inputCeDataType : innerInputType,
                                mapper,
                                reader);
                    }
                    if (inputCeDataType == null) {
                        
                        input = inputCloudEvent.data();
                    } else {
                        
                        input = inputCloudEvent;
                    }
                } else {
                    input = null;
                    inputCloudEvent = null;
                }

                final Consumer<Object> sendOutput = output -> {
                    try {
                        if (!invoker.hasOutput()) {
                            routingContext.response().setStatusCode(204);
                            routingContext.response().end();
                            return;
                        }

                        final CloudEvent<?> outputCloudEvent;
                        if (outputCeDataType == null) {
                            
                            CloudEventBuilder builder = CloudEventBuilder.create();
                            if (byte[].class.equals(innerOutputType)) {
                                outputCloudEvent = builder.build((byte[]) output, "application/octet-stream");
                            } else {
                                outputCloudEvent = builder.build(output);
                            }
                        } else {
                            
                            outputCloudEvent = (CloudEvent<?>) output;
                        }

                        String id = outputCloudEvent.id();
                        if (id == null) {
                            id = getResponseId();
                        }
                        String specVersion;
                        if (outputCloudEvent.specVersion() != null) {
                            specVersion = outputCloudEvent.specVersion();
                        } else if (inputCloudEvent != null && inputCloudEvent.specVersion() != null) {
                            specVersion = inputCloudEvent.specVersion();
                        } else {
                            specVersion = "1.0";
                        }
                        String source = outputCloudEvent.source();
                        if (source == null) {
                            source = (String) invoker.getBindingContext().get(RESPONSE_SOURCE);
                        }
                        String type = outputCloudEvent.type();
                        if (type == null) {
                            type = (String) invoker.getBindingContext().get(RESPONSE_TYPE);
                        }

                        boolean ceHasData = !Void.class.equals(innerInputType);

                        int majorSpecVer = parseMajorSpecVersion(specVersion);

                        if (binaryCE) {
                            httpResponse.putHeader("ce-id", id);
                            httpResponse.putHeader("ce-specversion", specVersion);
                            httpResponse.putHeader("ce-source", source);
                            httpResponse.putHeader("ce-type", type);

                            if (outputCloudEvent.time() != null) {
                                httpResponse.putHeader("ce-time", outputCloudEvent.time().toString());
                            }

                            if (outputCloudEvent.subject() != null) {
                                httpResponse.putHeader("ce-subject", outputCloudEvent.subject());
                            }

                            if (outputCloudEvent.dataSchema() != null) {
                                String dsName = majorSpecVer == 0 ? "ce-schemaurl" : "ce-dataschema";
                                httpResponse.putHeader(dsName, outputCloudEvent.dataSchema());
                            }

                            outputCloudEvent.extensions()
                                    .entrySet()
                                    .forEach(e -> httpResponse.putHeader("ce-" + e.getKey(), e.getValue()));

                            String dataContentType = outputCloudEvent.dataContentType();
                            if (dataContentType != null) {
                                httpResponse.putHeader("Content-Type", dataContentType);
                            }

                            if (ceHasData) {
                                if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                    httpResponse.end(Buffer.buffer(writer.writeValueAsBytes(outputCloudEvent.data())));
                                } else if (byte[].class.equals(innerOutputType)) {
                                    httpResponse.end(Buffer.buffer((byte[]) outputCloudEvent.data()));
                                } else {
                                    log.errorf("Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                            dataContentType, innerOutputType);
                                    routingContext.fail(500);
                                    return;
                                }
                            } else {
                                routingContext.response().setStatusCode(204);
                                routingContext.response().end();
                            }
                            return;
                        } else {
                            final Map<String, Object> responseEvent = new HashMap<>();
                            responseEvent.put("id", id);
                            responseEvent.put("specversion", specVersion);
                            responseEvent.put("source", source);
                            responseEvent.put("type", type);

                            if (outputCloudEvent.time() != null) {
                                responseEvent.put("time", outputCloudEvent.time());
                            }

                            if (outputCloudEvent.subject() != null) {
                                responseEvent.put("subject", outputCloudEvent.subject());
                            }

                            if (outputCloudEvent.dataSchema() != null) {
                                String dsName = majorSpecVer == 0 ? "schemaurl" : "dataschema";
                                responseEvent.put(dsName, outputCloudEvent.dataSchema());
                            }

                            outputCloudEvent.extensions()
                                    .entrySet()
                                    .forEach(e -> responseEvent.put(e.getKey(), e.getValue()));

                            String dataContentType = outputCloudEvent.dataContentType();
                            if (dataContentType != null) {
                                responseEvent.put("datacontenttype", dataContentType);
                            }

                            if (ceHasData) {
                                if (majorSpecVer == 0) {
                                    if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                        responseEvent.put("data", outputCloudEvent.data());
                                    } else if (byte[].class.equals(innerOutputType)) {
                                        responseEvent.put("datacontentencoding", "base64");
                                        responseEvent.put("data", (byte[]) outputCloudEvent.data());
                                    } else {
                                        log.errorf(
                                                "Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                                dataContentType, innerOutputType);
                                        routingContext.fail(500);
                                        return;
                                    }
                                } else {
                                    if (dataContentType != null && dataContentType.startsWith("application/json")) {
                                        responseEvent.put("data", outputCloudEvent.data());
                                    } else if (byte[].class.equals(innerOutputType)) {
                                        responseEvent.put("data_base64", (byte[]) outputCloudEvent.data());
                                    } else {
                                        log.errorf(
                                                "Don't know how to write ce to output (dataContentType: %s, javaType: %s).",
                                                dataContentType, innerOutputType);
                                        routingContext.fail(500);
                                        return;
                                    }

                                }
                            }

                            routingContext.response().putHeader("Content-Type", "application/cloudevents+json");
                            httpResponse.end(Buffer.buffer(mapper.writer().writeValueAsBytes(responseEvent)));
                            return;
                        }
                    } catch (Throwable t) {
                        routingContext.fail(t);
                    }
                };

                dispatch(inputCloudEvent, routingContext, invoker, input)
                        .getOutput()
                        .subscribe()
                        .with(sendOutput, t -> routingContext.fail(t));

            } catch (Throwable t) {
                routingContext.fail(t);
            }
        }));

    }