How can you interact with a running SPL application? - infosphere-spl

How can I interact with my running SPL application? E.g., if I want it to start or stop collecting certain stats, or if I want it to stop Export-ing certain properties?

In SPL, think about a stream whenever you need to send a message/data.
Create an input stream using a *Source operator (e.g., FileSource or UDPSource). When you want to interact with your running SPL application, send a message via that input source. The input stream operator will then send the message to a separate "parser" operator that can then act on the message.

Related

AS3 Variables from http query string

I am writing an air application in which some keystrokes are sent that activate functions.
Now, since this means that the application shall not be iconized (otherwise the shortcuts would not work), I want to understand if it is possible to send commands (variables) using http query strings.
I have an external device that is capable to send the requests for example: http://localhost/?var=1.
I tried opening a socket but it receives 0 length data when I send something.
Any other suggestion is of course welcome.
Thank you

Flutter: rendering an UI from JSON and store / map data dynamic

I want to render a UI from a jSON string that has multiple layers.
The user should be able to enter data, which will then be stored and shared, without the overhead of the jSON Render Structure.
However, the assignment of the data must be possible.
The app renders a template from a multidimensional json string that can capture metrics (user inputs). The measured data are entered via text fields by the user.
There are different windows in the app, which are rendered from different json UI-render-files.
The stored algorithms in the windows at the Frontend differ.
The following should be possible:
All windows are created with different jSON strings (works with build_value now).
The user's input is saved. (Currently only works by saving the render json string with the data under a different name (with Package: Shared Preferences)).
The data entered by the user is copied from one window to the other window. (Data Binding / Data Mapping)
The data entered by the user will be sent to a backend.
I only have the idea to use id's in the render json, which allow a mapping.
Are there better solutions?
Saving the entered data is possible by saving the whole jSON - String with an other name.
The goal is to map the data.
It should also be possible for the user to insert another object for the measurement data acquisition at the client / device. The entered data must also be saved.
This sounds like a REST API. Then you would use a frontend framework like angular or react to take user input.
I could build this with a .net core web api with sql db as the backend. this would be a web service (REST API solution) on the backend of your solution.
Next I would integrate Swagger with dependency injection and add authentication.
now its time to create the front end that will use your tested Web Service.
you would have 1 side of your SPA POST new JSON to the Web service in a form.
you would have the other side GET the new record as a new tab with pagination or in a table with pagination.
This would be a good PoC for your idea and will let you learn the parts of the solutions architecture in your language of choice. the "design" would be the same no matter what language your choice.
backend web service can be done in a flask and with a MySQL DB. or with any other combo you have skills with.
the Frontend could be done in knockout.js, making it a little easier to learn than angular or react.
Please create new questions when you choose your software design. I would love to give answers for each:)
I would love to level up with you! ;)

Send custom property with value as JSON array

We want to send some events to Application Insights with data showing which features a user owns, and are available for the session. These are variable, and the list of items will probably grow/change as we continue deploying updates. Currently we do this by building a list of properties dynamically at start-up, with values of Available/True.
Since AI fromats each event data as JSON, we thought it would be interesting to send through custom data as JSON so it can be processed in a similar fashion. Having tried to send data as JSON though, we bumped into an issue where AI seems to send through escape characters in the strings:
Eg. if we send a property through with JSON like:
{"Property":[{"Value1"},..]}
It gets saved in AI as:
{\"Property\":[{\"Value1\"},..]} ).
Has anyone successfully sent custom JSON to AI, or is the platform specifically trying to safeguard against such usage? In our case, where we parse the data out in Power BI, it would simplify and speed up a lot some queries by being able to send a JSON array.
AI treats custom properties as strings, you'd have to stringify any json you want to send (and keep it under the length limit for custom property sizes), and then re-parse it on the other side.

Connect to MYSQL database, retrieve data as JSON and send it to client side via AJAX

I am building an interactive web application with GWT, and I've come across a problem. The app is basically going to be a GUI for a database.
What I'd like to do:
Populate a MySQL server with data, and serve it via AJAX as a JSON file to my client side code.
The application life cycle should look like this:
Query on the client side -> Query the database -> serve up the requested information -> convert it to JSON -> Send back to client side via AJAX -> process on client side
I'd like to make this without refreshing the page, so the database querying should be ajax too.
If someone could point me to the right direction, I'd be really grateful. I've yet to find any good tutorials or examples to this type of problem.
Using GWT:
1° For Data-oriented app you will want to use GWT RequestFactory
2° If you want to stick to basic RPC here's what happens:
Fill up a form > Click on a button > make a call using RPC, passing a "shared" object as argument to your call > conversion from JSON to Java is handled by GWT > handle the request and make your query > convert the entity/DTO to a GWT "shared" object > your RPC controller returns the result > conversion to Java to JSON is handled by GWT > typically use a Celltable to display the result using a dataprovider, you won't need to reload the page.
If some parts of the process are unclear feel free to ask.
Don't use JSON unless there is some other reason you don't mention. A strong point of GWT is that you can use your entity code in your client side code so all of the client-server communication layer is hidden. Easiest way to do what you are asking:
Create #Entity annotated objects for each table
Create RPC service that exposes operations client needs
Implement database interactions with Objectify
Fetch your entities in GWT using RPC client

Couch DB bulk update using handlers

I'm using CouchDB and I have a situation where there are a bunch of documents keyed on user ids. I would like to be able to send a single query to update a particular field in all these documents. For example when a notification comes in, I'd like each user document to be updated with it by passing in the list of users to whom the notification applies and the notification message.
Sadly the _update handlers in CouchDB currently only support a single document at a time, so it's not possible to use an _update handler on multiple documents. For this, you'd need to build a small "proxy," server-side script that would receive the request and send individual _update handler requests one per document. Not ideal, but until there's a patch to allow bulk update handlers to be built, this is the way to go.
I've requested a _bulk_update handler (or similar) be added to a future version of CouchDB...as I'd like the feature as well. :)
https://issues.apache.org/jira/browse/COUCHDB-1303
I'd read _changes (probably apply a filter) and then execute the HTTP queries needed.
Keep in mind that you'll need to fetch the document, before updating it.