Support Questions
Find answers, ask questions, and share your expertise

how to put data in PutDistributedMapCache

Solved Go to solution
Highlighted

how to put data in PutDistributedMapCache

Expert Contributor

Hi,

I have a file, which can be used for lookup during a data flow. How do I read the file and put it in the DistributedCache?

Thanks,

Avijeet

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: how to put data in PutDistributedMapCache

Hi @Avijeet Dash

What @Jobin George suggested would help to share common static configuratiosn at various part of a NiFi flow.

In addition to that, if you'd like to know how to Put/Get from distributed cache, and how to enrich FlowFiles with cached values, this example might be helpful:

12393-1flow.png

Template file is available here:

https://gist.github.com/ijokarumawak/8ba9a2a1b224603f877e960a942a6f2b

Thanks,

Koji

View solution in original post

2 REPLIES 2
Highlighted

Re: how to put data in PutDistributedMapCache

Hi @Avijeet Dash,

See if this helps:

One easy way of loading key value pairs in NiFi is using NiFi Custom Properties registry. This is a comma-separated list of file location paths for one or more custom property files.

For example I can load a file named nifi_registry with key value pairs separated using '=' (say i have OS=MAC in it), and can reference ${OS} to substitute its value MAC using NiFi expression language(after restarting nifi). Its updated in nifi.property file using nifi.variable.registry.properties

12392-screen-shot-2017-02-12-at-111502-pm.png

You can read about it here:

https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#custom_properties

Thanks,

Jobin

Highlighted

Re: how to put data in PutDistributedMapCache

Hi @Avijeet Dash

What @Jobin George suggested would help to share common static configuratiosn at various part of a NiFi flow.

In addition to that, if you'd like to know how to Put/Get from distributed cache, and how to enrich FlowFiles with cached values, this example might be helpful:

12393-1flow.png

Template file is available here:

https://gist.github.com/ijokarumawak/8ba9a2a1b224603f877e960a942a6f2b

Thanks,

Koji

View solution in original post