Examples

TIBCO API Exchange Gateway software ships with sample projects, such as the following examples:

GetLocation

GetLocation example is shipped with a GetLocation BusinessWorks project. The project contains the client operations and back-end services, such as GetLocationService to be executed. The GetLocation service demonstrates the routing capability of TIBCO API Exchange Gateway.

The gateway interacts with a mock-up back-end service that returns the coordinates of a device associated with a phone number. The gateway routes the request to a different back-end service depending on the input phone number in the request.

Refer to ASG_HOME/examples/GetLocation/readme.html file for instructions on how to run the example.

BookQuery

The BookQuery service queries all the books in a book store using different criteria such as author, ISBN, publisher, and title. TIBCO API Exchange Gateway example project implements the following policies:

  • Rate Throttles
  • Quota Throttles
  • High Water Mark Throttles
  • Error Throttles

Refer to ASG_HOME/examples/BookQuery/readme.html file for instructions on how to run the example.

Caching

The Caching example demonstrates the caching functionality provided by TIBCO API Exchange Gateway.

The main components of this example:

  • ASG_CBA is a TIBCO BusinessWorks project that simulates an east side service. The service takes the firstIdentity field as a cross-reference key and translates its value. This project does a simple translation on the key using an XML file. Alternatively, the service can be an adapter call, a lookup in a database, or any other web service.
  • A SOAP service, which is hosted on TIBCO API Exchange Gateway. This service type is NOOP which means that it returns a XML document with a received key and a translated value.

After the translated value is received from the service implemented in the ASG_CBA BusinessWorks project, this is plugged into a SOAP payload. This payload is used to call a SOAP service running on TIBCO API Exchange Gateway.

When the CustomStage feature is applied to an operation configuration, it enables a set of rules in the ASG_DefaultImplementation project. When the operation request is invoked, it looks into the cache for a cross-reference before the routing step. It uses the value of firstIdentity as a key for the cross-reference. If a value for that key is present in the cache, it is used in the cross- reference. If a value is not found, it sends a TIBCO Rendezvous message to retrieve that value from the service in the ASG_CBA BusinessWorks project.

Refer to ASG_HOME/examples/Caching/readme.html file for instructions on how to run the example.