FSharp.CloudAgent icon indicating copy to clipboard operation
FSharp.CloudAgent copied to clipboard

Support Topics and Subscriptions

Open AndyCross opened this issue 10 years ago • 3 comments

Subscriptions are the bomb

In contrast to queues, in which each message is processed by a single consumer, topics and subscriptions provide a one-to-many form of communication, in a “publish/subscribe” pattern. Useful for scaling to very large numbers of recipients, each published message is made available to each subscription registered with the topic. Messages are sent to a topic and delivered to one or more associated subscriptions, depending on filter rules that can be set on a per-subscription basis. The subscriptions can use additional filters to restrict the messages that they want to receive. Messages are sent to a topic in the same way they are sent to a queue, but messages are not received from the topic directly. Instead, they are received from subscriptions. A topic subscription resembles a virtual queue that receives copies of the messages that are sent to the topic. Messages are received from a subscription identically to the way they are received from a queue.

By way of comparison, the message-sending functionality of a queue maps directly to a topic and its message-receiving functionality maps to a subscription

AndyCross avatar Jan 26 '15 17:01 AndyCross

This doesn't sound like it'll be too much work if the lower-level send/receive mechanisms are the same.

isaacabraham avatar Jan 27 '15 11:01 isaacabraham

@AndyCross can you have many receivers of a single subscription? so imagine you had ten instances of CloudAgent, would they need to each have a separate subscription to the topic or could they all receive on the same subscription?

isaacabraham avatar Jan 31 '15 16:01 isaacabraham

They can all receive on the same subscription, the queueing semantics are the same. The magic is in the pubsub which happens behind the scenes before the subscription client tries to pop from the queue.

Addressing the correct subscription is often done algorithmically so you should probably just let consumers of cloud agent supply the subscription to read


From: Isaac Abrahammailto:[email protected] Sent: ý31/ý01/ý2015 16:00 To: isaacabraham/FSharp.CloudAgentmailto:[email protected] Cc: Andy Crossmailto:[email protected] Subject: Re: [FSharp.CloudAgent] Support Topics and Subscriptions (#6)

@AndyCrosshttps://github.com/AndyCross can you have many receivers of a single subscription? so imagine you had ten instances of CloudAgent, would they need to each have a separate subscription to the topic or could they all receive on the same subscription?

— Reply to this email directly or view it on GitHubhttps://github.com/isaacabraham/FSharp.CloudAgent/issues/6#issuecomment-72323329.

AndyCross avatar Jan 31 '15 16:01 AndyCross