There is requirement to basically POST messages to REST endpoint to desired customer (out of fixed customer list, as below :
- Inbound Message I (has customer info) ---> Customer 1 ---(POST JSON)--> REST Endpoint 1 (basic auth)
- Inbound Message II (has customer info) ---> Customer 2 ---(POST JSON)--> REST Endpoint 2 (API Key)
- Inbound Message III (has customer info) ---> Customer 3 ---(POST JSON)--> REST Endpoint 3 (OAuth2)
- Inbound Message IV (has customer info) ---> Customer 2 ---(POST JSON)--> REST Endpoint 2 (API Key)
- Inbound Message V (has customer info) ---> Customer 3 ---(POST JSON)--> REST Endpoint 3 (OAuth2)
Currently I am using a single(because can set dynamically url by customer and outbound message format same) Feign Client (in spring boot app) to make call, but only able to implement for one customer (secured via OAuth), but as soon as try to add support for second (or third) customer, mix up is happening, with one customer endpoint issues spilling over to another, with fault tolerance implemented using Resilence4j. In other words, error in one endpoint causes CircuitBreaker to OPEN, preventing calls for other endpoints.
Any help/suggestions?