Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The data integration feature in the ESB profile of WSO2 EI supports data federation, which means that a single data service can expose data from multiple datasources. However, if you have multiple RDBMSs connected to your data service, and if you need to perform IN-ONLY operations (operations that can insert data and modify data in the datasource) in a coordinated manner, the RDBMSs need to be defined as XA datasources.

...

  1. Start the WSO2 ESB profile.

    Panel
    borderColor#542989
    bgColor#ffffff
    borderWidth1
    Localtabgroup
    Localtab
    activetrue
    titleOn MacOS/Linux/CentOS

    Open a terminal and execute the following command:

    Code Block
    sudo wso2ei-6.45.0-integrator
    Localtab
    titleOn Windows
    Go to Start Menu -> Programs -> WSO2 -> Enterprise Integrator 6.45.0 Integrator. This will open a terminal and start the ESB profile.
  2. Access the management console of the ESB profile: https://localhost:9443/carbon
  3. Sign in using admin as the username and password.
  4. On the Data Service menu click Create.
  5. Add a name for the data service and click Next.
  6. Select the Enable Boxcarring and Disable Legacy Boxcarring Mode check boxes.

    Note
    titleWhat is Boxcarring and Request Box?

    Boxcarring is a method of grouping a set of service calls so that they can be executed as a group (i.e., the individual service calls will be executed consecutively in the specified order). Note that we have now deprecated the boxcarring method for data services. Instead, we have replaced boxcarring with a new request type called request_box

    Request box is simply a wrapper element (request_box), which wraps the service calls that need to be invoked. When the request_box is invoked, the individual service calls will be executed in the specified order, and the result of the last service call in the list will be returned. In this tutorial, we are using the request box to invoke the following two service calls:

    1. Add a new employee to the database
    2. Get details of the office of the added employee

    When you click the Enable Boxcarring check box for the data service, both of the above functions (Boxcarring and Request box) are enabled. However, since boxcarring is deprecated in the product, it is recommended to disable boxcarring by clicking the Disable Legacy Boxcarring Mode check box.

  7. Click Next to go to the Datasources screen.
  8. Click Add New Datasource to create a datasource connection for the OfficeDetails database:

    Datasource IdEnter XAoffices as the datasource ID.
    Datasource Type

    Select RDBMS as the datasource type and s elect External Datasource from the adjoining field.

    Database Engine

    Select MySQL.

    Datasource Class Name

    Enter the database class that corresponds to MysqlXADataSource.class.
    Example: For MySQL 5, enter  com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

    Tip

    Make sure to check the path of the MysqlXADataSource.class and enter the updated path here. Else, you run into errors.

    Add New Property

    Specify the following connection settings for the OfficeDetails database:

    Property NameValue
    urljdbc:mysql://localhost:3306/OfficeDetails
    userEnter your MySQL server's username.
    Example: root
    passwordOptionally: Enter your MySQL server's password. 
    If you have not assigned a password, do not add this property.

    Example: The New Datasource screen will now look as follows:

  9. Save the XAoffices datasource.
  10. Click Add New Datasource to create a datasource connection for the EmployeeDetails database as follows:

    Datasource IdEnter XAemployees as the datasource ID.
    Datasource Type

    Select RDBMS as the datasource type and select External Datasource from the adjoining field.

    Database Engine

    Select MySQL.

    Datasource Class Name

    Enter the database class that corresponds to MysqlXADataSource.class.
    Example: For MySQL 5, enter com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.

    Tip

    Make sure to check the path of the MysqlXADataSource.class and enter the updated path here. Else, you run into errors.

    Add New Property

    Specify the following connection settings for the EmployeeDetails database:

    Property NameValue
    urljdbc:mysql://localhost:3306/EmployeeDetails
    userEnter your MySQL server's username.
    Example: root
    passwordOptionally:Enter your MySQL server's password. 
    If you have not assigned a password, do not add this property.

    Example: The New Datasource screen now look as follows:

  11. Save the XAemployees datasource and click Next.

...