Versions Compared

Key

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

...

The EventingSample data service used here, is based on the functionality of managing the inventory of a car/motorcycle dealership. It contain the following queries:

  • addProductQuery: This query adds a addProduct: A new product is added to the catalog using the addProductQuery query.
  • updateProductQuantityQuery: This query updates the updateProductQuantity: The availability of a certain product is updated using the updateProductQuantityQuery query. This is linked with an input event trigger, which monitors if whether the stock of this product is critically low. If so, if fires an event notifying the subscribers that this product's stock needs to be updated.
  • getProductByCodeQuery: This query retrieves product information, given the product codegetProductByCode: When the product code is given, the getProductByCodeQuery query retrieves product information. The company gives special attention to people querying the database for motocycles. So when a query is made where the product type is a motorcyle"motorcycle", an output trigger associated with this query is triggers and a message is sent sends messages to the respective subscribers, which is our email address in this casesample.

Building the sample

The sample data servic e EventingSample should be deployed using the instructions in Samples Setup section.

Pre-requisites

  1. In the sample, we define a specific topic for events to be published, and an email address is added as a subscription for that topic. In order to allow mails to be sent, we have to configure the mail sender in the client Axis2 configuration. A sample axis2.xml file for the client configuration is stored in <DSS_HOME>/samples/resources/sample_axis2_client.xml. Use it to replace the <DSS_HOME>/repository/conf/axis2/axis2_client.xml file. The axis2_client.xml contains an already configured mail sender section and is ready to be used.
  2. Edit the data service by adding a valid email address: Here we use the XML Edit option to edit the dataservice. In the XML view, replace all occurences of "test@test.com" with your own email address and restart the server.

Building the sample

...

  1. .

Running the Sample

The sample service can be run using the TryIt   tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in the Data Services Clients section.

...