3

I have a number of WPF clients on the same corporate network. I want these clients to share messages with each other. I don't want to run a separate server process so a brokerless solution would seem best. I have considered using PNRP but this seems to require a PNRP service to be running on each client, I'm not sure I could guarantee all the clients would or could be running this. I have also had a look at ZeroMq which looks ideal it terms of simplicity and its very lightweight, however I would need to know the endpoints for a TCP/IP style communication and each client won't be aware of the others rather they need someway to discover each other. So essentially I want a multicast style of communication but without having to use multicast since this will require me to get a range of addresses set up within the corporate network and involve infrastructure etc.

So I guess the question is are there any options I haven't considered that fit the bill?

Thanks in advance for any help.

user630190
  • 1,142
  • 2
  • 11
  • 26

6 Answers6

4

The ZeroMQ pub-sub pattern is simple and fast until you reach hundreds of clients; you can switch to a real multicast protocol then (PGM) without modifying your application.

Pieter Hintjens
  • 6,599
  • 1
  • 24
  • 29
3

Perhaps you should check out NServiceBus. It is a true service bus, so no broker machines in the middle. It runs on MSMQ so your windows servers will support that out of the box. It also supports transactional messaging. It also supports a pub/sub model that should satisfy your multicast requirement.

Davin Tryon
  • 66,517
  • 15
  • 143
  • 132
  • +1 NServiceBus has been a fantastic option for us and just sits silently and does what it is supposed to do no messing about. – Mr. Mr. Nov 08 '12 at 15:58
  • 1
    I don't have any windows servers just clients running xp. Correct me if I'm wrong but the clients would need MSMQ installing and running before NServiceBus would be an option. – user630190 Nov 08 '12 at 16:11
  • 1
    Thats correct. Also NServiceBus doesn't do any kind of discovery - you need to know all the endpoints beforehand. – tom redfern Nov 09 '12 at 10:50
2

If you don't mind using a commercial product: OMG's Data Distribution Service is a standard with several implementations that can do what you are looking for. At least one of them supports C# and does not require anything to be installed on your machines -- just the libraries. Disclosure: I work for this company.

So essentially I want a multicast style of communication but without having to use multicast since this will require me to get a range of addresses set up within the corporate network and involve infrastructure etc.

DDS by default uses UDP/IP over multicast for discovery and communication, but can be instructed programmatically or via configuration files to use UDP over unicast only, or TCP. This does not affect application logics, so the conceptual multicast nature is preserved. However, if you do not have IP multicast at your disposal then you will lose some out-of-the-box automatic discovery features. In this case, you would need to know in advance the IP addresses or host names of all nodes that could potentially participate in the communication. From there, the middleware will be able to discover who of these is actually present and adjust its communications accordingly.

I think the latter is true for any solution you choose though. For fully automatic discovery, you will need either multicast/broadcast, or some known discovery server(s) running in your system.

Reinier Torenbeek
  • 16,669
  • 7
  • 46
  • 69
2

We've written a peer-to-peer message bus, Zebus, based on ZeroMQ (transport), Cassandra (peer discovery and persistence) and Protobuf (serialisation).

It is open source and production tested https://github.com/Abc-Arbitrage/Zebus

Zebus is being actively developed and it is in heavy in-house production use. Currently there is only a .NET language binding but as the OP mentioned that he only had WCF clients this should meet his needs.

Slugart
  • 4,535
  • 24
  • 32
  • 1
    could you please also add a few paragraphs on current **`Zebus`** development status and list all stable ports / language binding currently available? Thanks. – user3666197 Apr 28 '16 at 13:57
1

Have you considered the peer to peer protocol for WCF? See here for more details: http://msdn.microsoft.com/en-us/library/cc297274.aspx

sga101
  • 1,904
  • 13
  • 12
  • Yes I have considered this but it requires PNRP to be installed on all the clients. I'm really looking for a solution that doesn't require any changes to the clients and can be managed purely from my code. – user630190 Nov 08 '12 at 16:16
0

ZeroMQ is a good choice for this. To solve the discovery problem, stand a server that every client checks in when starting and stopping. This server can also be running ZeroMQ as both a publisher and subscriber.

The clients publish to one port on the server, which binds a subscriber to that port to get check-in and check-out messages. The server in turn publishes those messages on another port (which it also binds) to which the clients subscribe.

Ed Power
  • 8,310
  • 3
  • 36
  • 42