-1

AM new to esql, in my message flow have a lookup file which contains some values for forking messages. Now i have a new requirement to read a value from lookup cache file and search for string, so if contains particular string duplicate the messages and fork to multiple queues if string doesn't exists fork to single queue. Can someone help with this ??

Thanks, Vinoth

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
user3171821
  • 69
  • 1
  • 12

1 Answers1

0

You should not read the file for every message, but instead cache the contents of the file in SHARED variables.

For this your message flow should have 2 input queues, one for getting the messages to route, and the second for a technical queue which would receive messages to initiate the reload of the file into cache.

This second part of the flow should look like this: MQ Input -> File Read -> Compute

And put the logic of storing the file contents to SHARED variables into the Compute.

So as you see, you don't read the file in ESQL, you do that by using the File Read node in your flow, and use ESQL only to process the file contents. And you can access the values stored in the SHARED variables in the first part of the flow where you do the routing.

Attila Repasi
  • 1,803
  • 10
  • 11