Member since
04-09-2023
3
Posts
0
Kudos Received
0
Solutions
04-13-2023
04:25 PM
I am trying to setup a mongo extractor process using GetMongo with Mongo X509 auth. It works from my Java code using the following properties. 1. Mongo URI - mongodb://C=US,ST=Texas,O=Test Inc.,OU=management:ad.group.372,CN=test.com@host1:10900,host2:10901,host3:10901/eos-uat?replicaSet=testApp&journal=true&authMechanism=MONGODB-X509 2. Keystore 3. Keystore password 4. Trustrore 5. Truststore password I am trying with the same props in Nifi and throws the following error. o.a.nifi.processors.mongodb.GetMongo GetMongo[id=44d0b0a4-0187-1000-c77e-135ce0fedc67] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to java.lang.IllegalArgumentException: Invalid mechanism, MONGODB_x509 does not support passwords java.lang.IllegalArgumentException: Invalid mechanism, MONGODB_x509 does not support passwords at com.mongodb.ConnectionString.createMongoCredentialWithMechanism(ConnectionString.java:893) at com.mongodb.ConnectionString.createCredentials(ConnectionString.java:832) at com.mongodb.ConnectionString.<init>(ConnectionString.java:447) at org.apache.nifi.processors.mongodb.AbstractMongoProcessor.getClientSettings(AbstractMongoProcessor.java:267) at org.apache.nifi.processors.mongodb.AbstractMongoProcessor.createClient(AbstractMongoProcessor.java:256) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:145) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:133) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:78) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:55) at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$8(StandardProcessorNode.java:1736) at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) SSLContext Service validation passes without any issues for the given keystore, keystore password, truststore, truststore passord. Not sure why the above error is coming.
... View more
Labels:
- Labels:
-
Apache NiFi
04-10-2023
08:15 AM
1 Kudo
@udayabaski, as @steven-matison mentioned, the best solution would be to use the Distributed Map Cache. In order to implement it, you can follow these steps to initialize your Server: https://stackoverflow.com/questions/44590296/how-does-one-setup-a-distributed-map-cache-for-nifi/44591909#44591909 Now, regarding the way you want to incorporate it in your flow, I would suggest the following: - right after UpdateAttribute, you activate the PutDistributedMapCache. Within the processor, you will set the desired attribute at the property Cache Entry Identified. - Before InvokeHTTP, you add a FetchDistributedMapCache with which you extract the value for your key:value pair. All you have to do next is to extract your attribute to further use in your invokeHTTP. It is as simple as that and you do not need any fancy configurations 🙂
... View more