prashant-r / Scalaris

DHT Chord Transaction
Apache License 2.0
0 stars 0 forks source link

Publish-subscribe #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What are publish and subscribe for?
How to use them?
and What do they actually do in the scalaris node?
do they write - read any thing ?
Please provide a detailed idea of both of them.

Original issue reported on code.google.com by gauravpa...@gmail.com on 21 May 2010 at 11:03

GoogleCodeExporter commented 8 years ago
Pubsub is providing a simple topic-based publish-subscribe system. You can use 
the
java-api-client to play with it (java-api/scalaris).

You can register/subscribe a URL for a topic:
./scalaris --subscribe scalaris_news http://localhost:8080/my_process
It will store the key-value pair ("scalaris_news",
[http://localhost:8080/my_process]) in scalaris. When you publish a message 
under the
scalaris_news topic, scalaris will do a JSON-rpc call to the stored URL.
./scalaris --publish "scalaris_news" "there is a new svn revision"

There is a unit-test in java showing how to receive notifications from java:
testSubscription1 in java-api/test/de/zib/scalaris/ScalarisTest.java

Original comment by schu...@gmail.com on 28 May 2010 at 8:11

GoogleCodeExporter commented 8 years ago

Original comment by schin...@gmail.com on 7 Jul 2010 at 12:40