wso2complex-event-processingsiddhievent-stream-processing

On-Demand Query with siddhi fails


I'm using the wso2 stream integrator in order to run my siddhi application. The operating environment is windows 10 pro. I'd like to ask you for your help about way of using Siddhi's REST API.

  1. Open a command prompt as the administrator and go to \wso2si-1.1.0\bin. Then, execute the command server.bat --run.
  2. Deploy any siddhi files in wso2si-1.1.0\wso2\server\deployment\siddhi-files, and it's working correctly.
  3. Open a new command prompt and execute the command curl -X GET "http://localhost:9090/siddhi-apps" -H "accept: application/json" -u "admin:admin" -k.
  4. The command succeeds and a list of applications is displayed.
  5. Next, I defined the ABC as named-window on FlowApp and executed the command curl -X POST "https://localhost:9443/query" -H "content-type: application/json" -u "admin:admin" -d "{"appName" : "FlowApp", "query" : "from ABC select *" }" -k
  6. The above query fails and "Problem accessing: /query. Reason: Not Found" is displayed on the command prompt.

Why can't I find "/query"?


Solution

  • By default query API is available in a different port. Try port number 7443

    curl -X POST "https://localhost:7443/query" -H "content-type: application/json" -u "admin:admin" -d "{"appName" : "FlowApp", "query" : "from ABC select *" }" -k