Service A sitting on JBOSS want to talk to Service B on Tomcat . Here Service B is supposed to perform multiple operations say 4(Create a Directory,Write to a file(Few KBs) and save it to directory,Update a DB Table and send an email).
is it optimum to refactor service B in 4 small services and trigger those 4 from Jboss ? or i should have only one service only doing 4 stuffs in one shot ?
In the sceanrio you described I would not refactor Service B. Personally I tend to keep REST services more coarse grained as possible, preferably as a composition of more service classes I write as if they were library classes. I can't see the point of calling 4 different endpoints, to perform relatively simple operations like the ones you are talking about.