ashwinraghav / mynotify

1 stars 1 forks source link

Redundant notifications for files inside subscribed directories #8

Closed ashwinraghav closed 11 years ago

ashwinraghav commented 11 years ago

In out current scheme, when there is a subscription for /dir/, when /dir/foo or /dir/bar is created the subscriber to the directory /dir is notified. Although we have eliminated issuing duplicate subscriptions to the same file or dir from clients, we have not eliminated this Duplication. In the above scheme, if we also have a subscriber to /dir/foo, we add a separate watch for the subscriber although a subscriber to dir already has metadata in place on the server for this notification to be sent.

Enter TOPIC EXCHANGE: http://www.rabbitmq.com/tutorials/tutorial-five-java.html

When a subscriber subscribes to a file whose immediate upper directory is under subscription, then the subscriber can just attach himself to the queue of the upper level directory with a topic filter that ensures that he receives notifications only for that file. What this means that from now on, when any message is published, it has to be published with a topic since an exchange is no longer a 'fanout' but might selectively push messages.

Ashwin