Show TOC

Example RequestsLocate this document in the navigation structure

Example requests for subscribing, publishing, and unsubscribing.

The following JSON requests can be used with the timeccl example project located at STREAMING_HOME/examples/java/wspexample/project/timeccl.ccl.

Subscribing
{
	"topic": "/default/timeccl/InputWindow1",
	"messageType": "SUBSCRIBE",
	"subscribeOptions": {
            "base": "true"
    },
	"authorization":"Basic c3R1ZGlvOnN5YmFzZQ=="
}
Subscribing with SQL
{
	"topic": "/default/timeccl",
	"messageType": "SUBSCRIBE",
	"subscribeOptions": {
		"base": "false"
	},
	"sql": "Select * from InputWindow1 where C_KEY<100",
	"authorization":"Basic c3R1ZGlvOnN5YmFzZQ=="
}

Publishing
{
    "topic": "/default/timeccl/InputWindow1",
    "event": {
		"count": "1",
		"time": "2014-02-23T12:33:12.432Z",
		"opCode": "INSERT",
		"value": [
			{
			"C_KEY": "1",
			"C_TIMESTAMP": "2014-02-01T19:12:56.123Z"
			}
		]
	},
	"publishOptions": {
         "bufferSize": "3"
	},
	"messageType": "PUBLISH",
	"authorization":"Basic c3R1ZGlvOnN5YmFzZQ=="
}
Unsubscribing
{
	"topic": "/default/timeccl/InputWindow1",
	"messageType": "UNSUBSCRIBE",
	"authorization":"Basic c3R1ZGlvOnN5YmFzZQ=="
}