You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by ds...@apache.org on 2013/10/28 16:40:01 UTC

svn commit: r1536380 - /incubator/streams/site/trunk/content/streams-usage.mdtext

Author: dsullivan
Date: Mon Oct 28 15:40:01 2013
New Revision: 1536380

URL: http://svn.apache.org/r1536380
Log:
adding instructions for streams web service

Modified:
    incubator/streams/site/trunk/content/streams-usage.mdtext

Modified: incubator/streams/site/trunk/content/streams-usage.mdtext
URL: http://svn.apache.org/viewvc/incubator/streams/site/trunk/content/streams-usage.mdtext?rev=1536380&r1=1536379&r2=1536380&view=diff
==============================================================================
--- incubator/streams/site/trunk/content/streams-usage.mdtext (original)
+++ incubator/streams/site/trunk/content/streams-usage.mdtext Mon Oct 28 15:40:01 2013
@@ -122,6 +122,91 @@ Now, POST some JSON activitystrea.ms to 
            }
      }
 
+---
+
+> *Apache Streams Web Service Setup*
+
+---
+
+Before starting you will need the following software:
+
+[Cassandra] [2]
+
+[Tomcat] [3]
+
+[Streams Master][4]
+
+[Streams Source][5]
+
+Streams is designed for deployment in Apache Tomcat. Apache Cassandra acts as a persistence layer.
+
+To begin run mvn install from within the streams-master directory and then from within the streams-source directory:
+ 
+     mvn install
+
+This will generate a war file located in the streams-web/target directory. Before starting Tomcat, you will need to start Cassandra. To do this, run:
+
+     ./bin/cassandra -f
+
+from within your Cassandra installation. The -f starts Cassandra in the foreground, omission of -f will start it in the background
+
+Copy the streams-web.war to the /webapps directory of tomcat and start Tomcat:
+
+     ./bin/startup.sh
+ 
+from within your Tomcat installation
+
+
+Testing Throughput
+==================
+
+You can use any utility capable a sending HTTP requests, but Chrome's Advanced Rest Client browser plugin is simple and easy to use.
+
+With your HTTP utility of choice set up a publisher by POSTing JSON like the following to http://localhost:8080/streams-web/app/publisherRegister
+
+     {
+         "src": "www.example.com"      
+     }
+
+The service will return a URL that can be POSTed to with ActivityStrea.ms formatted JSON.
+
+Next setup a subscriber by POSTing JSON like the following to http://localhost:8080/streams-web/app/subscriberRegister
+
+     {
+         "filters": [
+             "tags"
+         ]
+     }
+
+This will return a unique URL that can take GET and POST requests.  POST requests should contain JSON like the above to reconfigure the endpoint, GET requests will return activity streams JSON.
+
+Now, POST some JSON activitystrea.ms to the URL you received for the Publisher and then GET the URL you received for the Subscriber. Note that the publisher src url and activity provider url are required to match. The subscriber will return activity with tags that correspond to the subscribers filter. The following is an example of a valid activity a publisher can POST:
+
+     {
+         "verb": "verb",
+         "tags": "tags",
+         "provider": {
+              "url": "www.example.com"
+         },
+         "actor": {
+              "id": "actorid",
+              "objectType": "actorobject",
+              "displayName": "actorname",
+              "url": "www.actorexampleurl.com"
+         },
+         "target": {
+               "id": "targetid",
+               "displayName": "targetname",
+               "url": "www.targeturl.com"
+         },
+         "object": {
+               "id": "objectid",
+               "displayName": "objectname",
+               "objectType": "object",
+               "url": "www.objecturl.org"
+           }
+     }
+
 
 [1]: http://servicemix.apache.org/
 [2]: http://cassandra.apache.org/download/