ESB 1 contains a CRUD repository for XSLT sheets. The repository is backed by a JDBC database where sheets are stored as BLOBs. A REST API provides endpoints for users to create, update and delete sheets. The API is exposed by API Gateway.
ESB 2 receives JMS messages with XML data and distributes them among various consumers. For each consumer, the XML data has to be transformed differently, using a specific stylesheet from the repository on ESB 1.
Proposed solution
The transformation on ESB 2 is performed using the respective service from the WmXSLT package. Since this service accepts either a file path or a URL as the XSLT source, my idea was to pass a URL to fetch the sheet via HTTP from ESB 1. The URL identifies the sheet that is appropriate for a given consumer.
However, the question that remains is: how should ESB 1 serve the XSLT when ESB 2 requests it over HTTP?
The file path is considered to point to the local file system where the ESB is running.
When using URL, the target server should present the stylesheet as file from its web directory.
So you will have to find a solution how to place the file being retrieved from the DB accordingly.
Using URL approach this might require reloading/restarting certain parts of the application to make the server being aware of the files.