0

I have a real life SOA problem that I can't seem to solve in a clean SOA manner.

I have many distributed producers of "update thing" messages which get consumed by the "thing manager".

One of the features of the "thing manager" is to publish to a topic notification that the "thing" has changed. This allows other interested services to react to the change.

One of the "update thing" producers is itself a listener to the topic. It is only really interested in "thing updates" from other systems. But it finds itself consuming and processing updates from the "thing manager" that it itself caused in the first place (and hence already knows about). Luckily the feedback loop is broken at that point.

How best to solve this problem in a clean SOA manner? I do not class adding metadata to the message indicating message source to be a clean solution; a message consumer should never have to know where a message came from or is going to.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Mike
  • 1

1 Answers1

0

When an "update thing" subscribes to a "thing manager" it should be able to set filters on what "things" it wants to subscribe to. One filter that all "update thing"s should set is do not send me anything that originated from myself. Then the "update thing" would not know the origin of the message but the "thing manager" would.

Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
  • Thanks Kevin - the nature of the data is the same whatever the origin. So there is nothing about the data structure itself which would enable selective consumption. I think what you are suggesting then would be for the originator of the original update to mark up the message header - which is something that feels wrong to me from a SOA perspective. One of the reasons is that there are quite often many processes in between the event origin and the thing manager - and each would have to know to carry the metadata through and not replace it with its own ID... – Mike Feb 02 '12 at 14:21
  • It does not have to go in a message header. "thing manager" must have a subscription list to know who to send messages out to. What identifies the other services to call in this list. Include this in the data structure. If you are working with services that are out of your control and have well defined contracts that cannot change then the issue is different from a system you designing from scratch. And perhaps I am making a huge assumption that you are using a publish/subscribe design pattern. – Kevin Junghans Feb 02 '12 at 15:39
  • Ah, but that would be a point to point architecture and unfortunately we have a pub/sub (topic based, not queue based) architecture. The thing manager doesn't need to know who it needs to tell about stuff, it just does its job, and things subscribe and react if they feel like it. Perhaps this becomes a question of whether topic based pub/sub is a good or a bad thing in terms of large scale SOA systems? P2P becomes fragile, but workflow can be easily traced and monitored. Pub/Sub less so but easier to evolve the system. But clearly, easy also to introduce feedback loops... – Mike Feb 02 '12 at 16:24
  • Could you please answer http://stackoverflow.com/questions/9553267/soa-design-parameter-decision ? – LCJ Mar 04 '12 at 08:04