What is the best way for a publisher to expose a publication? I would think that it would be just 3 pieces of information:
- The schema of the messages
- The encoding of the messages
- The endpoint where new subscription endpoints can be registered
For #1, I can see this being shared in a number of ways: WSDL, XSD, .cs file, .dll
For #2, it would probably be binary, SOAP, JSON, etc.
For #3, I can see this being shared as a Publisher/PublisherInputQueue or maybe a connection string to a Subscription DB
My question is, with all of these options, which is the best choice? Especially for #1 and #2, I would like to know pros/cons of the differe开发者_如何学编程nt options. Thanks!
For #1, you can give subscribers the DLL or generate an XSD for it using the XsdGenerator.exe tool.
For #2, when doing pub/sub, you usually want loosely coupled interaction so using the XmlSerializer will probably be your best choice. When it comes to clients that are sending commands to a server, you may prefer the BinarySerializer.
As to #3, this is something that administrators usually manage.
精彩评论