Skip to content

LabelSubscriptionServer

busterwood edited this page Feb 12, 2018 · 2 revisions

A proxy for multicast queues with label based subscriptions, see LabelSubscription for the supported label matching and wildcard syntax.

Properties:

  • ClientRequestQueueFormatName the format name of the non-transactional queue that client requests are sent to
  • MulticastInputQueueFormatName the format name of the non-transactional queue that data arrives on, typically a multicast address

Methods:

  • StartAsync() starts the proxy
  • StopAsync() stops the proxy
  • Dispose() also stops the proxy

Why?

Often you multicast between a few servers, but don't want to multicast to hundreds of clients in case one slow client affects every client's multicast traffic. This proxy would live on a server, and clients subscribe and unsubscribe from multicast traffic by sending messages to the server's input queue.

How to subscribe

Send a message to the servers client request queue with:

  • AppSpecific set to PubSubAction.Add (0)
  • Label set to tag to subscribe for, e.g. "MyOrders", or "AllOrders"
  • Body set to the subscriptions to add, one per line (UTF-8 text), which may end with wildcards * or **
  • ResponseQueue set to the format name of the client-specific queue to send messages with matching labels too

See LabelSubscription for the supported label matching and wildcard syntax.

How to unsubscribe

Send a message to the servers client request queue with:

  • AppSpecific set to PubSubAction.Remove (1)
  • Label set to tag to subscribe for, e.g. "MyOrders", or "AllOrders"
  • Body set to the subscriptions to remove, one per line (UTF-8 text), which may end with wildcards * or **
  • ResponseQueue set to the format name of the client-specific queue to send messages with matching labels too

See LabelSubscription for the supported label matching and wildcard syntax.

How to set the subscriptions for a client and tag

Send a message to the servers client request queue with:

  • AppSpecific set to PubSubAction.Set (3)
  • Label set to tag to subscribe for, e.g. "MyOrders", or "AllOrders"
  • Body set to the subscriptions, one per line (UTF-8 text), which may end with wildcards * or **
  • ResponseQueue set to the format name of the client-specific queue to send messages with matching labels too

Setting subscriptions will:

  • add any new subscriptions
  • removes existing subscriptions that are not in the supplied list

How to cancel all subscriptions for a client and tag

Send a message to the servers client request queue with:

  • AppSpecific set to PubSubAction.Clear (9)
  • Label set to tag to subscribe for, e.g. "MyOrders", or "AllOrders"
  • ResponseQueue set to the format name of the client-specific queue to send messages with matching labels too

How to list all subscriptions for a client and tag

Send a message to the servers client request queue with:

  • AppSpecific set to PubSubAction.List (5)
  • Label set to tag to subscribe for, e.g. "MyOrders", or "AllOrders"
  • ResponseQueue set to the format name of the client-specific queue to send messages with matching labels too

A message will then be sent to the ResponseQueue with the message Body containing the current subscriptions, one per line (UTF-8 text)