开发者

NServiceBus: Using WSDL to make types discoverable

开发者 https://www.devze.com 2023-01-10 02:10 出处:网络
What is the best way for a publisher to expose a publication?I would think that it would be just 3 pieces of information:

What is the best way for a publisher to expose a publication? I would think that it would be just 3 pieces of information:

  1. The schema of the messages
  2. The encoding of the messages
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消