gus-maurizio opened a new issue #2532: URL: https://github.com/apache/camel-quarkus/issues/2532
A camel quarkus route that processes JSON files in a directory runs into warnings for every file processed using JSONPATH. Camel Quarkus 1.8.1 with camel 3.9.0 The purpose of the route is to filter out those files that do not have a top level Record element. For those that do have it, split the body and process every record. LOG when running the runner jar file. ``` 2021-04-28 20:07:28,879 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.9.0 (AppName.Cloudtrail) started in 296ms (build:0ms init:147ms start:149ms) 2021-04-28 20:07:28,880 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Pooled mode enabled. Camel pools and reuses objects to reduce JVM object allocations. 2021-04-28 20:07:28,880 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Lightweight mode enabled. Performing optimizations and memory reduction. Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime INFO: quarkus181-cloudtrail 1.0.0 on JVM (powered by Quarkus 1.13.2.Final) started in 2.414s. Listening on: http://0.0.0.0:8080 Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime INFO: Profile prod activated. Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime INFO: Installed features: [camel-attachments, camel-controlbus, camel-core, camel-direct, camel-file, camel-java-joor-dsl, camel-jsonpath, camel-log, camel-management, camel-microprofile-health, camel-microprofile-metrics, camel-platform-http, camel-rest, camel-support-common, camel-timer, camel-xml-jaxb, camel-yaml-dsl, camel-zip-deflater, cdi, mutiny, smallrye-context-propagation, smallrye-health, smallrye-metrics, vertx, vertx-web] 2021-04-28 20:07:29,878 INFO [App.Clo.Readfiles] (Camel (AppName.Cloudtrail) thread #0 - file://data/cloudtrail) FILE {CamelFileAbsolute=false, CamelFileAbsolutePath=/Users/SNP144/Source/quarkus/quarkus181-cloudtrail/data/cloudtrail/good.json, CamelFileLastModified=1619654623338, CamelFileLength=622, CamelFileName=good.json, CamelFileNameConsumed=good.json, CamelFileNameOnly=good.json, CamelFileParent=data/cloudtrail, CamelFilePath=data/cloudtrail/good.json, CamelFileRelativePath=good.json} 2021-04-28 20:07:29,881 INFO [App.Clo.HeartBeat] (Camel (AppName.Cloudtrail) thread #1 - timer://java) HEARTBEAT Random: 73 Apr 28, 2021 8:07:29 PM io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans WARN: ================================================================================ CDI: programmatic lookup problem detected ----------------------------------------- At least one bean matched the required type and qualifiers but was marked as unused and removed during build Removed beans: - PRODUCER_METHOD bean io.quarkus.jackson.runtime.ObjectMapperProducer#objectMapper() [types=[interface com.fasterxml.jackson.core.Versioned, interface java.io.Serializable, class com.fasterxml.jackson.core.ObjectCodec, class com.fasterxml.jackson.databind.ObjectMapper, class com.fasterxml.jackson.core.TreeCodec], qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]] Required type: class com.fasterxml.jackson.databind.ObjectMapper Required qualifiers: [] Solutions: - Application developers can eliminate false positives via the @Unremovable annotation - Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem - See also https://quarkus.io/guides/cdi-reference#remove_unused_beans ================================================================================ 2021-04-28 20:07:29,963 INFO [App.Clo.Readfiles] (Camel (AppName.Cloudtrail) thread #0 - file://data/cloudtrail) FILE {CamelFileAbsolute=false, CamelFileAbsolutePath=/Users/SNP144/Source/quarkus/quarkus181-cloudtrail/data/cloudtrail/Bad.json, CamelFileLastModified=1619654636211, CamelFileLength=620, CamelFileName=Bad.json, CamelFileNameConsumed=Bad.json, CamelFileNameOnly=Bad.json, CamelFileParent=data/cloudtrail, CamelFilePath=data/cloudtrail/Bad.json, CamelFileRelativePath=Bad.json} Apr 28, 2021 8:07:29 PM io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans WARN: ================================================================================ CDI: programmatic lookup problem detected ``` The route is ``` from("file://{{datadir}}?idempotent=true&noop=true").routeId("AppName.Cloudtrail.Readfiles") .log("FILE ${headers}") // .unmarshal().gzipDeflater() .choice() // use true to suppress exceptions .when().jsonpath("Records", true) .to("direct:ctrecord") .otherwise() .to("direct:ctinvalid"); from("direct:ctrecord").routeId("AppName.Cloudtrail.CTRecord") // .split().jsonpathWriteAsString("$.Records[*]") .to("log:out0?level=OFF"); from("direct:ctinvalid").routeId("AppName.Cloudtrail.CTInvalid") .log("INVALID ${headers}"); ``` and the files look like ``` { "Records": [ { "eventVersion": "1.08", "eventTime": "2021-04-26T23:53:10Z", "eventCategory": "Data" }, { "eventVersion": "1.08", "eventTime": "2021-04-26T23:53:24Z", "eventSource": "lambda.amazonaws.com", "eventName": "InvokeExecution", "awsRegion": "us-east-1", "eventCategory": "Data" }, { "eventVersion": "1.08", "eventTime": "2021-04-26T23:53:17Z", "eventSource": "lambda.amazonaws.com", "eventName": "Invoke", "sharedEventID": "c33094dd-e57a-46b6-9086-b8b58771d619", "eventCategory": "Data" } ] } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
