XML File as input

Hi!

I’m testing zato to replace some integrations currently running on mule community edition but the input channels of zato seem a little limited, what I need to do is use XML files as input do some process on the data, store in a DB and then generate another xml file.
Is there some way to tell zato to monitor a directory and load new xml file as the come in, or do I need some kind of external program to read the files and then feed them to zato?

Thank you

Yes, you can create a service that uses inotifyx to listen for events in a given directory and invoke another service on each new file.

Thank you for your reply.
Just to be clear, this service that uses inotifyx would be external and invoking a service that runs in zato, or it will be all inside zato?

Hello @rafaelsp,

please check it out here:

https://zato.io/blog/posts/file-notifications-2.0.html

Regards.

By the way, @rafaelsp, prompted by your question I’m currently working on a mechanism that will in Zato 3.0 offer a configuration file such as this one below.

That is, there will be default directories to drop directories to, each with its own default callback service or services that you will be naturally able to replace with your own ones.

Plus, you will have means to include additional directories through the [include] stanza.

That, I believe, should cover it all nicely and I would be very interested in your feedback.

pickup_from=./static
pattern=*
callback=zato.pickup.static
delete_after_pickup=False

[zato_conf]
pickup_from=.
pattern=*.conf
callback=zato.pickup.conf
delete_after_pickup=False

[zato_incoming_json]
pickup_from=../../incoming/json
pattern=*.json
callback=zato.pickup.json
delete_after_pickup=True

[zato_incoming_xml]
pickup_from=../../incoming/xml
pattern=*.xml
callback=zato.pickup.xml
delete_after_pickup=True

[zato_incoming_csv]
pickup_from=../../incoming/csv
pattern=*.csv
callback=zato.pickup.csv
delete_after_pickup=True

[include]
user_pickup_conf=./user-pickup.conf

Hi dsuch

That is great, thank you very much. In the meantime I’ll try the method of the blog post.
For the 3.0 solution additionally to the “delete_after_pickup” option, there could be a “move_to_after_pickup”