Question

I have a bit of a design issue - I will try to explain as clearly as I can.

I have a web service which takes messages from one system, parses the message and passes the formatted data to another application (via messaging a webservice inside that application - we will call this "appservice" from now). Many of the classes are related and the Id of the newly saved classes are returned by the system which the appservice returns. The returned ID's are then added to a mapping table maintained by the middle webservice using nhibernate.

The issue I have is that I need to make the whole process transactional (so that if something goes wrong the whole thing is rolled back and the web service returns a failed result to the client system).

So the question is one of design -

should I pass all of the information in one big message to the appservice and return a large message of mapping Id's to the web service? (this is my current favored idea)

OR

should I build up a transactional statement bit by bit at the appservice end with multiple messages?

OR

Is there a better way?

Thanks

Was it helpful?

Solution

Given a few things (from your comments):

  1. The services are stable
  2. Speed/performance isn't a factor
  3. They are (the messages) parsed quickly
  4. They are (the messages) relatively small in size

I would just parse it as one big message and then handle that new message however you will.

NOTE: I am curious as to how this will all work out for you so, please, keep me updated!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top