jeudi 19 avril 2018

How to make independent module with delayed callback information in Java project?

Im writing a project in Java with Spring boot. Im trying to write independent module (maven module) which sends data to verification.

Process looks like:

  1. Post data to REST API, get verification ID.

  2. Ask REST API (using ID) after some time about verification status or make REST endpoint and automatically get informed by external API when verification is done.

So in my independent module I got REST endpoint which gets data from fronted and sends it to external API. Then I retrieve assigned ID (which needs to be added to User Entity) and I don't know how to pass it to Main project module. My independent module does not know that Main module exist. Also I don't know how to pass verification status when my independent module will be informed by external API.

Is my idea a good approach at all ? Or maybe I should place REST endpoints in Main module and treat my independent module as service (through interface) which only sens data and retrieve ID? But then REST endpoint which expect information from external API also must be in Main module and I won't feel that this is separated functionality.

Thanks for any architecture advices.

Aucun commentaire:

Enregistrer un commentaire