WSO2 CEP STREAMS - wso2

I create input and output streams in my WSO2 CEP (v3.1.0) with event formatter and event builder as well. I need to find out where this streams are created in WSO2 CEP catalog structure, becasue I can't find it beyond event builder and formatter (wso2cep-3.1.0\repository\deployment\server).
Has anyone know where I can find this streams files?
Kacu

I managed to load streams via xml (only during startup), by modifying the stream-definitions.xml file in this folder wso2cep-3.1.0/repository/conf/data-bridge.
You can take a look at this page in the documentation for more details, just keep in mind that the location written in the documentation doesn't match what I found in the server.

In CEP 3.1.0, event streams are stored in the registry (which comes with CEP), it is not stored in filesystem. Streams can be located under governance section of the registry (See streamdefinitions sub directory)..
Regards,
Mohan

Related

WSO2 CEP export event streams, event receivers etc

I am new in WSO2 Cep and I would like to ask if anybody knows that how can I export the event streams, event receivers, etc. which I have create in order to have a backup, from the WSO2 CEP Management console?
Thanks in advance!
CEP deployable artifacts that are created from Management Console are stored in the file system. You can find them in <CEP_HOME>/repository/deployment/server folder.
Event Streams can be found in directory eventstreams
Event Receivers can be found in directory eventreceivers
Event Publishers can be found in directory eventpublishers
Execution Plans can be found in directory executionplans
Then, just create a backup of above directories.
When you create an artifacts from management console they are persisted in file system under CEP_HOME/repository/deployment/server. Under this directory you can find event streams, receivers, executions plans, etc. So you can take a backup of this folder to make a backup of your current artifacts.
Regards

Update wowza StreamPublisher schedule via REST API (or alternative)

Just getting started with Wowza Streaming Engine.
Objective:
Set up a streaming server which live streams existing video (from S3) at a pre-defined schedule (think of a tv channel that linearly streams - you're unable to seek through).
Create a separate admin app that manages that schedule and updates the streaming app accordingly.
Accomplish this with as a little custom Java as possible.
Questions:
Is it possible to fetch / update streamingschedule.smil with the Wowza Streaming Engine REST API?
There are methods to retrieve and update specific SMIL files via the REST API, but they only seem to be applicable to those created through the manager. After all, streamingschedule.smil needs to be created manually by hand
Alternatively, is it possible to reference a streamingschedule.smil that exists on an S3 bucket? (In a similar way footage can be linked from S3 buckets with the use of the MediaCache module)
A comment here (search for '3a') seems to indicate it's possible, but there's a lot of noise in that thread.
What I've done:
Set up Wowza Streaming Engine 4.4.1 on EC2
Enabled REST API documentation
Created a separate S3 bucket and filled it with pre-recorded footage
Enabled MediaCache on the server which points to the above S3 bucket
Created a customised VOD edge application, with AppType set to Live and StreamType set to live in order to be able to point to the above (as suggested here)
Created a StreamPublisher module with a streamingschedule.smil file
The above all works and I have a working schedule with linearly streaming content pulled from an S3 bucket. Just need to be able to easily manipulate that schedule without having to manually edit the file via SSH.
So close! TIA
To answer your questions:
No. However, you can update it by creating an http provider and having it handle the modifications to that schedule. Should you want more flexibility here you can even extend the scheduler module to not require that file at all.
Yes. You would have to modify the ServerListenerStreamPublisher solution to accomplish it. Currently it solely looks a the local filesystem to read teh streamingschedule.smil file.
Thanks,
Matt

Solutions within WSo2 ESB for Processing Zip files

I have the following requirement :
“Copy a Zip file from a sftp server to a directory on a local server, then unzip the file and extract 2 Xml files from inside it to process in our message service we have setup within our ESB.”
I have done some several searches over the past week on the internet, as well as read several topics in the Wso2 documentation but I cannot find a clean way to implement this requirement. I found this question asked on stackoverflow already - https://stackoverflow.com/questions/27806557/wso2-esb-extracting-and-processing-zip-files
However, I did not see where there were any suggestions/solutions provided. My first thought is to build a sequence with a class mediator to handle the extraction of the 2 xml files I need from the zip file, but maybe there is a better approach?
Is there any recommendations, links, or other references that folks could provide or suggest that would help me move forward with implementing this requirement? Or is this something I will need to handle outside of ESB via script with cron control?
Please kindly note that I'm assuming that you are using ESB 4.8.1
Since this is a specific requirement we don't have an out of the box solution for your scenario. However, you can easily do this using WSO2's VFS transport and a custom class mediator. The procedure would be:
Read your zip file using VFS Transport and save it in your local server.
Next, create a class mediator which unzip your zip file and then read your XML files. For more details about how to write a class mediator please refer Class Mediator.
If you need more help regarding this issue please let me know.
Thanks,
Upul
In the newer version of the ESB, the File Connector supports zip/unzip operations: https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the+File+Connector+Version+2

Where are stream definitions in WSO2CEP 3.0.0 stored?

I could not find where the description of the streams defined via UI are stored? Are they stored on h2 database or in an xml file? If the answer is file, where this file is located?
Stream definitions are stored in the embedded registry of the CEP server. You can access this via the registry UI. But it is not recommended to edit registry definitions in this manner.
If you want certain stream definitions to be available at the time of starting the server, you can define them in the XML file /repository/conf/stream-manager-config.xml. However, please note that this file will be read only at server startup and there is no hot deployable feature available for stream definitions currently. You can refer to the following link [1] for more information.
[1] http://docs.wso2.org/display/CEP300/Working+with+Event+Streams

File Extension to MIME Type Web Service?

Are there any web services which will allow me to provide a file extension and it would return a list of possible MIME types?
For example:
http://mimetype.com/getMime/doc
Which could return:
application/msword,application/docappl/text,application/vnd.msword,application/vnd.ms-word,application/winword,application/word,application/x-msw6,application/x-msword
I don't want to use Urlmon.dll and I would prefer not having to keep my own list up-to-date.
Thanks
I just created this as part of my mimetype <-> icon service
http://stdicon.com/
For example :
http://stdicon.com/ext/html
It runs on appengine so it should have high availability.
The only thing I could imagine would be parsing the list which comes with the apache server
mime.types. The list is maintained by The Apache Software Foundation and depends on www.iana.org
Though its not exactly what you are asking for, this information is available via search by format in the PRONOM registry. The result is more fine-grained than MIME types, but you can get MIME info if available for the results (e.g. here, in the 'identifiers' section). There is also the DROID tool available to access this information via GUI, Java API or command line interface.
Sorry that I don't have a webservice for the task on hand, but you could use the fileext page and maybe parse the response if you can query the extension programmatically. Maybe a first step in the right direction.
This webservice could be very simple, a small DB / in memory store which could be as simple as a Dictionary<String, String> and just do a key lookup and return the result.
The first dataset could be (for example) based on http://www.webmaster-toolkit.com/mime-types.shtml.
The problem would probably be the hosting of such a webservice.
I don't know if there is a web service that would do this, but the libmagic library (http://en.wikipedia.org/wiki/Libmagic) is used for identifying filetypes and might be helpful for you.
The only thing that comes to mind is to parse output from http://www.file-extensions.org/
It won't give you the MIME type, but the good olde' Microsoft File Association Web Service could still help you. You access it this way:
http://shell.windows.com/fileassoc/0409/xml/redir.asp?Ext=xls
where 0409 means English (US) and xls is the file extension. On the plus side, it will be there and constantly updated... well, until Microsoft decides to pull the plug. Which can happen any time.