mardi 18 août 2015

To have a REST service as a plugin

Lets say I have some REST service A running. As part of a client request, it does steps 1, 2 and 3. I want to enable a few third party REST servers to be able to do step 2 for me. Lets say REST services B, C or D could plug in into / register with A and do the step 2 on its behalf.

So the flow would look something like:

  1. Service B registers with A (or A discovers B somehow) with its config - URL, security supported, version, etc.

  2. A gets a request from a client, performs 1, makes a call into B, gets the response back from B and then performs 3 before responding the result to the client.

What design pattern should be followed here to ensure extensibility and scalability? One of the challenges I see here is the need to ensure contract between A and B or C is correct.

Aucun commentaire:

Enregistrer un commentaire