This is a feature that will be added in much a broader scope - along with GUI, API and more usage examples - in next releases, but for 1.1, a zato-labs project is provided to support an invoke/retry pattern.
This can be used to implement any of these scenarios
- invoke a service synchronously and if it fails, repeat the invocation a configured number of times waiting blockingly for the response
- invoke a service synchronously and if it fails, invoke the service asynchronously in background notifying a callback service when it's finished, successfully or not
- invoke a service asynchronously in background, and if it fails, repeat the invocation a configured number of times notifying a callback service when it's finished, successfully or not Install the add-on by putting it on PYTHONPATH, for instance, using pip and linking it to zato_extra_paths as below. This is a change that needs a server restart.
$ sudo pip install zato-invoke-retry Downloading/unpacking zato-invoke-retry ... [snip] ... Successfully installed zato-invoke-retry Cleaning up... $
$ ln -s /usr/local/lib/python2.7/dist-packages/zato /opt/zato1/zato_extra_paths $
You can now make use of invoke/retry as in the code examples below.
As an ending note, this feature is a good example of Zato's extensibility. No changes were needed to support it and only publically available features and API were used to add new value on top of existing core platform.