Stratos 1.6.0 - Messaging between Storage Server and Data Service Service - wso2

I am configuring Stratos 1.6.0 and trying get the following scenario working.
Create a database in Storage Server
Create a user in Storage Server
Assign the user to the database
Generate datasource for the user/database combination in the Storage Server
Create DataService in Data Service Server and use the data source above
From what I can see in the code... when one creates a datasource in a Carbon application, the org.wso2.carbon.ndatasource.core.DataSourceRepository will notify the member's in the cluster of the new DataSource. These members will then invalidate the registry cache.
The problem comes is that in the default clustering configuration in Stratos 1.6.0, the Storage Server and the Data Service Server are in different Tribe domains, so messaging using Tribe is not possible between the two types of applications.
How can one get the Data Service Server to update its datasource configuration when datasources are created in the Storage Server?

What you've mentioned in your query itself is exactly what's expected from providing the option to create a datasource via WSO2 Storage Server. However, there are certain technical complexities associated with sharing datasources across nodes/clusters of different Carbon products (other than the type of Carbon product in which the datasources are created) and we're currently in the middle of attending to them. Therefore, all considered, a better way to integrate SS with DSS would be, first create your database/database user in WSO2 SS, then create datasources with that information (connection strings, user credentials, etc) in WSO2 DSS and consume them.
Regards,
Prabath
P.S. You can refer http://sparkletechthoughts.blogspot.in/2013/04/relational-storage-solution-using-wso2.html which provides you with a comprehensive guide for creating databases/database users/privilege templates.

Related

How to implement Edge computing using WSO2

I am currently running WSO2 Analytics on a windows server but I want implement the analysing part somehow that a client can connect to the server and do some processing like visualization on its own rather than all processing being done on the server. Is this something possible on WSO2 platform?
Thanks
You can setup database you want ( see the documentation ). For production usage I woudn't even recomment using the bundled H2 database. WSO2 analytics supports number of databases by default, I believe Oracle is one of them.
As stated in the comments - you can create a client or service which reads the data from the database and displays them its own way.
most challenging part for me is that how the client uses the information from the database?
This is already on your own (outside scope of this question). You've asked if your client can access the analytics (result) data - yes you can. How to do that is up to you. (depending what the client is, ..)
For example at our client they are building data APIs which are directly consumable by different frontend libraries creating nicer charts and reports.

What WSO2 technologies can I use to implement something like this? Is Enterprise Integration the right choice?

I am absolutly new in the WSO2 world and I have the following problem.
I have to developer a toolkit application and the customer says to me that, if possible, they want introduce WSO2 technologies in this project. I will try to explain what exactly this toolkit project have to do to try to understand if and what WSO2 technologies eventually can match with the requirement.
The toolkint project have to do:
1) When executed have to connect to a local database and perform some queries.
2) Use the data obtained from the previous query to create an XML document.
3) Send this XML document into a request to a web service (I think that the content of this XML will be put into the request body of the sended request).
4) Use the web service response to update some data in the local database.
So I am trying to understand if there are some WSO2 technologies that match these requirements or if it is better to create this toolkit as a simple standard Java program.
Searching online I have identified WSO2 Enterprise Integration and WSO2 Data Services Server (that I think it is included into WSO2 Enterprise Integration).
At the beginning I had thought to use Data Services Server to access to the DB, perform the queries and so retrieve data from the DB tables.
But reading the official documentation (https://docs.wso2.com/display/DSS351/About+Data+Services+Server) it seems to me that it is more a technology thinked to expose a DB using web service, infact in this documentation I can read:
Data services provide a convenient mechanism to configure a Web
service interface for data in various datasources such as relational
databases, CSV files, Microsoft Excel sheets, Google spreadsheets
etc...
Infact reading this official tutorial: https://docs.wso2.com/display/DSS351/Quick+Start+Guide
it seems to me that if does the opposite of what I have to do.
IT DOES:
SET THE DB CONNECTION.
PERFORM THE QUERY.
EXPOSE THE DATA RETURNED BY THIS QUERY AS A WEB SERVICE.
I HAVE TO DO:
SET THE DB CONNECTION.
PERFORM THE QUERY.
SEND THE OBTAINED DATA TO A WEB SERVICE (in XML format).
So it seems to me that Data Services Server is not the right choice because it seems to me that more than help me to do data access, data manipulation and send these data to an endpoing it is useful to do data access and to expose these data as a web service (but maybe I am missing something).
So I am trying to understand if WSO2 Enterprise Integration contains some modules that better fulfills my requirements.
Reading the official documentation (https://docs.wso2.com/display/EI600/Enterprise+Integration+Patterns) it seems to me that I can use:
1) BPEL/BPMN process to define the operations flow.
2) It seems to me that I can do DB queries but I always have the same doubt (that it is used to expose the retrieved data as service and not to use internally, it seems to me that this is WSO2 Data Services Server putted into WSO2 Enterprise Integration).
3) I think that this module provides me a way to aggragate data from some queries into an XML document: https://docs.wso2.com/display/EI600/Transforming+Message+Content
4) I can send a request with the previous generated XML usingsomething like this: https://docs.wso2.com/display/EI600/Sending+a+Simple+Message
So can you help me to identify what WSO2 techonlogies I can use to implement something like this or if it is better to implement it manually in pure Java?
1) When executed have to connect to a local database and perform some queries.
R:/For this point you can create a data service using DSS or EI.
2) Use the data obtained from the previous query to create an XML document.
R:/You can create a proxy service using the ESB or EI, inside the proxy service you call the data service created in the previous point(using call mediator) and get the response message in a property mediator to create a new payload message(using payload, enrich or/and a xslt mediator).
3) Send this XML document into a request to a web service (I think that the content of this XML will be put into the request body of the sended request).
R:/Inside the proxy service created in the previous point and after the creation of the new payload message you can send that payload to another webservice using call mediator.
4) Use the web service response to update some data in the local database.
R:/ You can get the response message, create a new payload message and call another data service, or another operation of the same data service created in the first point.
UPDATE 1:
you can use the IDE or the web UI, as you like. for the implementation check this out: Combine two queries using WSO2 ESB as a start.
Inside the IDE you can go to Developer Studio menu, clic in OpenDashboard and create a "ESB Solution Project" or a "ESB Config Project" for the ESB stuff, and a Data Service Project for the data service.

Multi-Tenant Enterprise Application Architecture and WSO2 Product Selection and Communication

I am planning to implement enterprise application using wso2. I have following list of functions in my application and I have already chosen wso2 products for them.
Dynamic Business Process - WSO2-BPS 3.0.1
Dynamic Rule -- WSO2-BRS 2.0
Integration with LDAP, Sharepoint -- WSO2-IS 4.0
SOAP & REST Services -- WSO2-AS 5.0.1
My concerns are:
1) How can I share resources (configuration files, registries, etc) between products?
2) If I create Tenant in IS then How it will be available to other carbon products. can I use same tenant in other carbon products?
3) Can I externalize storage of Tenants?
4) Single sign on (logged in one product can also access other products)
You can simply achieve this via our stratos Which will provide you to access to tenants from one product to another using centralised user store and you can use the Single sign on with Stratos which is by default available within products. You can play around with stratos from this.
If you download the local setup of stratos which will have all the WSO2 products as already pre-configured to run them in your private cloud. You can refer the README in the local setup pack for more information to run the setup.

Is there a way to clone the deployed data service on the WSO2 DSS

I created a data web service on the WSO2 Data Services server, now I would like to use it as a template so I can create more services out of it.
Is there a way to copy/paste the service XML to a new one?
I would like to skip the wizard mode creation.
Go to service Dashboard and there you have "edit data service (xml edit)" option available. That can be reused to create similar services. create a .dbs file out of that xml content and deploy through upload data service option in the management console (Change the data service's name). Following link would be useful.
[1] http://docs.wso2.org/wiki/display/DSS301/Work-In-Progress+Service

How is the password of the data source stored in the WSO2 Data Services Server?

In the data services server, one of the step is to create a Data Source, in which you need to supply the connection URL as well as the database userId and password.
My questions are
how is this password store in the data services server?
Is the password encrypted and what kind of encryption is used?
Is the password stored in a database or a file?
Where can I find out more about this as there is not much details in the documentation?
I need to find answers to these questions as these will be potential questions from the database security team when we plan to roll out WSO2 DSS to the live environment.
If no answers will also appreciate any links or emails that I can send my queries to.
if you use current release of a data service server this information is stored in the registry.
with the next release it will be possible to specify these as an xml file and secure the xml file using secure valult.
By default data services does not encrypt the password entries that are in the .dbs files. You can use Synapse datasource.properties file to define global datasources and access them as "Carbon Datasources" from data services. These data in the datasource.properties file can be encrypted using secure vault functionality, for more info, check [1].
Also, in the DSS v2.6.3 release, we had partial secure vault implementation, but it is not publicly documented, but can still accessed from here [2]. That implementation is not fully integrated to Carbon secure vault implementation, and you will have to write your own "SecretCallBackHandler"s.
From the upcoming DSS v3.0.0 release, which is to be released soon, it will contain proper secure vault functionality by integrating to Carbon secure vault, where you can give aliases to the password fields from the data service wizard itself. Also, we also have new XML configurations for defining global data sources, which is independent from Synapse, and is also integrated with secure vault.
[1] http://wso2.org/project/esb/java/4.0.0/docs/samples_setup_guide.html#datasource
[2] http://wso2.org/project/data-services/2.6.3/docs/secureVault.html
Cheers,
Anjana.