Skip to content

Instantly share code, notes, and snippets.

Created April 11, 2017 19:50
Show Gist options
  • Save anonymous/f85155085729f39e2a63f6c90ecf1837 to your computer and use it in GitHub Desktop.
Save anonymous/f85155085729f39e2a63f6c90ecf1837 to your computer and use it in GitHub Desktop.
namespace com.ibm.streamsx.inet.http.sample;
use com.ibm.streamsx.inet.http::*;
/**
* This sample connects to the specified URL and prints the streaming data.
*/
public composite HTTPStreamSample
{
graph
stream<rstring data> Result = HTTPGetStream()
{
param
url : getSubmissionTimeValue("url");
}
() as Writer = Custom(Result)
{
logic
onTuple Result:
{
println("result: " + (rstring)Result + "\n");
rstring url = "https://bi-hadoop-prod-4015.bi.services.us-south.bluemix.net:8443/gateway/default/hbase";
list<rstring> headers= [];
mutable int32 err = 0;
rstring res = httpGet(url, headers, "ndsilva", "biclusterpassw0rd",err);
printStringLn(res);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment