Skip to content

LabelSubscription

busterwood edited this page Feb 12, 2018 · 2 revisions

Create a QueueDispatcher to subscribe to a messages with matching labels.

Methods:

  • StartAsync() to start the dispatcher
  • StopAsync() to stop the dispatcher
  • Dispose() also stops the dispatcher
  • Subscribe() registers a callback to be called when a message is read with a matching label

Properties:

  • Separator label part separator, defaults to dot .
  • Wildcard wildcard used to match the last part of the label, defaults to star *
  • AllDecendents wildcard used to match the last parts of a label , defaults to star **

Why?

Sometimes you just observe published information, for example market prices, and multicast is an efficient way to distribute that type of information. The information publisher may send more information than your application is interested in, so you can use a QueueDispatcher to filter the incoming multicast messages based on the label.

Label matching example

Message label hello.world.123 would be match by a subscription:

  • hello.world.123
  • hello.world.*
  • hello.**
  • **

The follow do not match the example:

  • hello.world
  • hello.world.123.abc
  • hello.*.123 - wildcards are only valid for the last part
  • **.123 - wildcards are only valid for the last part

Also See

LabelSubscriptionServer.