Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

how to put data in PutDistributedMapCache

avatar
Super Collaborator

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

avatar

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

avatar

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

avatar

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