Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
So there are few instances where we have to merge multiple services into a single service with Multiple Endpoints. Lets Take and example here.
1st service endpoint like : Productcolor/Operation
2nd service end point like : Productprice/Operation
we can merge these 2 endpoints saying that : Product/Color and Product/Price in a single service. so the Best way to use the endpoints is to add "if" Trigger conditions based on the "URI".
So how "IF" Trigger helps?
So when ever we are integrating multiple endpoints into a single service, and run the process it activates all the components which will leads to more JVM memory consumption. So If we use IF triggers only that flow will be activated after IF condition which needs to be run, rest other flows will be de-activated.
Suppose you have 30 components in 1st endpoint Flow and 20 components in the 2nd Flow , If you don't use the IF Triggers it will activate all the 50 components and memory consumption will be high which lead to Degraded response Time,And if you use "IF Trigger" (Like condition if URI.equals("Color")) then it will only activate that flow which satisfy the condition it wont activate the other flow. which will Optimize the Response.
This is not an ideal design. There is no reason I can think of for so many operations to be contained in one service. Why is this necessary? What if you need to amend one particular operation? You will have to take down all of your services to make a change.