1

Is it recommended to save the below data in transform message or under src/main/resources and call it while doing transformation?

product_id product_name category_id
1 Pear 50
2 Banana 50
3 Orange 50
4 Apple 50

I currently put it in transform message so wanted to know if that's the good approach.

Magda
  • 13
  • 2
  • In MuleSoft or in Mule runtime? One is a company, the other is a product. You probably mean the later. Share what you are actually doing (text only). Are you having any issues? – aled Aug 19 '23 at 14:39
  • Requirement is we have to compare this predefined data with the dynamic value from sql database so I want to save this above table information to compare during processing. – Magda Aug 19 '23 at 14:49
  • That doesn't address the questions I made. You should add the actual current implementation so we can understand what you are actually doing in the code. And fix the tags and terminology of the question. – aled Aug 19 '23 at 16:37

1 Answers1

1

Storing static data in either the transform message or src/main/resources is perfectly acceptable, as long as you don’t anticipate frequent changes. However, opting for src/main/resources might be more beneficial for other developers, as it allows easier review in case of any modifications. The use of multiple transform messages in the application could make reviewing data stored in transform messages more complex.

If you foresee frequent changes to the data, moving it to property files is recommended. This approach enables you to modify values on the fly without the requirement to rebuild the application.

jarus
  • 201
  • 1
  • 2