public void process()

in library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/format/DataTypeProcessor.java [53:72]


    public void process(Exchange exchange) throws Exception {
        if (exchange.hasProperties() && exchange.getProperties().containsKey(DATA_TYPE_FORMAT_PROPERTY)) {
            format = exchange.getProperty(DATA_TYPE_FORMAT_PROPERTY, String.class);
        }

        if (format == null || format.isEmpty()) {
            return;
        }

        Optional<DataTypeConverter> dataTypeConverter = doConverterLookup();
        dataTypeConverter.ifPresent(converter -> converter.convert(exchange));

        if (!dataTypeConverter.isPresent()) {
            LOG.debug("Unable to find data type for scheme {} and format name {}", scheme, format);

            if (!ignoreMissingDataType) {
                throw new CamelExecutionException(String.format("Missing data type for scheme %s and format name %s", scheme, format), exchange);
            }
        }
    }