This example toolkit com.ibm.ssb.inet provides a number of operators to provide connectivity to external systems using well-known standards.
Pinned topic Connectivity toolkit with HTTP REST APIs to streaming data added - Now at version 2.1.0
Re: Connectivity toolkit with HTTP REST APIs to streaming data added2012-07-10T18:43:49ZThis is the accepted answer. This is the accepted answer.Version 1.0.4 has been uploaded which adds support for query parameters attribute and suppress for HTTPTupleView to allow control over what data is extracted from tuples for a GET request.
Updated on 2012-07-10T18:43:49Z at 2012-07-10T18:43:49Z by DanDebrunner
DOJO live chat and table example!2012-07-25T22:28:54ZThis is the accepted answer. This is the accepted answer.The StreamsExchange wiki now has a page with an example of using a DOJO chart and table with HTTPTupleView to have live visualization of streaming data from a browser.
Re: Connectivity toolkit with HTTP REST APIs to streaming data added2012-10-09T21:20:26ZThis is the accepted answer. This is the accepted answer.Can you please provide a more in-depth step by step guide on how to run HTTPTupleView example? I created a new SPL Application project and copy pasted the main composite code into the project. Then added com.ibm.ssb.inet to the toolkit location in Streams Studio and added the dependency to the project. I also copied the data folder containing the HTML file and JS file into the Resources folder of the project replacing the data folder that already had. I built and launched the SPL App as Standalone but when I try to access 127.0.0.1:8080 in a browser it doesn't connect. Any suggestions?
Re: Connectivity toolkit with HTTP REST APIs to streaming data added2012-10-10T21:08:52ZThis is the accepted answer. This is the accepted answer.I figured it out. All the jetty and servlet jar files from text toolkit were missing, that's why the web server was not running at all. I download it the missing files and put them at the right directory and now it's working like a charm.
Re: Connectivity toolkit with HTTP REST APIs to streaming data added2012-10-17T15:58:39ZThis is the accepted answer. This is the accepted answer.
- danlopezv 270005M02A
Support for IBM InfoSphere Streams 3.0 added2013-01-16T06:44:05ZThis is the accepted answer. This is the accepted answer.Version 1.0.10 has been uploaded which includes:
See the com.ibm.ssb.inet_README.pdf contained in the toolkit for details.
- Support for IBM InfoSphere Streams 3.0 (and continued support for 126.96.36.199)
- Support for loading web applications (war files) by the REST operators from the webapps directory relative to the context base
- WebContext operator to allow a toolkit to provide web resources at a known context (URL path)
- WebAppsPortsConnector operator to allow arbitrary servlets through web applications to interact with input ports and/or output ports
Support for Jetty 7.6.102013-04-12T15:58:31ZThis is the accepted answer. This is the accepted answer.The HTTPTupleView and HTTPTupleInject operators now can use Jetty 7.6.10.By default the toolkit will use Jetty 6 from the Streams install.
To use Jetty 7.6.10 create a symbolic link from com.ibm.ssb.inet/opt/jetty to a Jetty 7.6.10 install.
The next version of the toolkit will support arbitrary versions of Jetty 7 or later
- Unpack Jetty 7.6.10 in the opt directory in the toolkit. This will create the directory jetty-distribution-7.6.10.v20130312 in opt.
- Create a symbolic link jetty that links to jetty-distribution-7.6.10.v20130312
ln -s jetty-distribution-7.6.10.v20130312 jetty
Re: Support for Jetty 7.6.102013-05-09T14:36:46ZThis is the accepted answer. This is the accepted answer.
- DanDebrunner 120000GEAB
The HTTPTupleInjection operator is written to expect POST data encoded as key-value pairs
Is it possible that in future versions the operator can be able to get data with different encoding schema? e.g. If I send POST data as XML or JSON format that the operator might be able to read it and pass it to streams as a single string.
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException
StringBuffer sb = new StringBuffer();
String line = null;
BufferedReader reader = request.getReader();
while((line = reader.readLine()) != null)
String toStreams = sb.toString();
Re: Support for Jetty 7.6.102013-05-11T16:01:16ZThis is the accepted answer. This is the accepted answer.
- danlopezv 270005M02A
That's a possibility for the future.
For now you should be able to have the JSON in a single parameter and then using the JSONHelpers operators (on Streams Exchange) to convert them into a tuple. So the HTTPTupleInjection would just have a single attribute of type rstring.
Similar for XML, but using the XMLParse operator.
Re: Support for Jetty 7.6.102013-05-13T14:04:32ZThis is the accepted answer. This is the accepted answer.
- DanDebrunner 120000GEAB
Well parsing the data is not the problem in this case. The problem is that the HTTP post method is expecting content type: application/x-www-form-urlencoded and the appliance that is sending the data to the web server is sending it with content type: application/xml (parameters are never set).
Version 2.1.02013-11-05T16:43:36ZThis is the accepted answer. This is the accepted answer.
Version 2.1.0 provides these updates:
- Support for InfoSphere Streams 3.0, 3.1 and 3.2.
- Jetty 8.1.3 provided in the toolkit from Eclipse 4.2.2
Richer SPL type support for JSON output of HTTPTupleView
- The JSON encoding added in Streams 3.0 is now used to convert tuples to JSON
- Thus SPL maps, lists, sets and embedded tuples are supported by the operator
Support for Streams 2.0 is dropped, please use the older versions if you need run on Streams 2.0.
madmanu 060001W7G52 Posts
Re: Connectivity toolkit with HTTP REST APIs to streaming data added - Now at version 2.1.02013-11-18T13:20:59ZThis is the accepted answer. This is the accepted answer.
Thanks a lot for the Toolkit. Forgive my ignorance, would it be a good idea to use the Jetty server to expose a URL that an external application can push to Streams ? Would that be a possible use case for the toolkit.
Re: Connectivity toolkit with HTTP REST APIs to streaming data added - Now at version 2.1.02013-11-18T18:08:42ZThis is the accepted answer. This is the accepted answer.
- madmanu 060001W7G5
That's what the HTTPTupleInject operator does. You can use HTTP POST to send data into an application as a tuple.
AdrianL 270001S1NU2 Posts
Cross origin access to HTTPTupleInjection2013-12-17T16:13:55ZThis is the accepted answer. This is the accepted answer.
How can I configure the Jetty server to allow cross origin access to HTTPTupleInjection? I have a web application from which I want to sent tuples to Streams but see this error at the client:
XMLHttpRequest cannot load http://localhost:8080/fromPsinapse/PriorityNodes/ports/output/inject/0?ipAddress=188.8.131.52. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8001' is therefore not allowed access.
I've investigated using the instructions here: http://wiki.eclipse.org/Jetty/Feature/Cross_Origin_Filter but cannot work out where the web.xml file goes for the embedded server.
david.cyr 270004TRU91 Post
Re: Cross origin access to HTTPTupleInjection2014-01-14T20:50:39ZThis is the accepted answer. This is the accepted answer.
- AdrianL 270001S1NU
I wanted to check to see if there was a resolution to the 'Access-Control-Allow-Origin' header problem, as I am encountering the same issue.
Thanks in advance for any assistance,
AdrianL 270001S1NU2 Posts
Re: Cross origin access to HTTPTupleInjection2014-01-15T09:53:01ZThis is the accepted answer. This is the accepted answer.
- david.cyr 270004TRU9
In the end the workaround I'm using is to put a proxy for HTTPTupleInjection on the same web server as the web application that sends tuples to HTTPTupleInjection, the proxy just forwards the request. Using this technique Chrome does not see any cross origin access and so does not block the call to HTTPTupleInjection.