Consuming a Service Deployed in TIBCO Cloud Mesh

This feature describes how to use TIBCO Cloud Mesh in an application in the TIBCO Cloud Integration Environment and TIBCO Business Studio client.

TIBCO Cloud Mesh allows you to discover any private REST endpoint exposed within TIBCO Cloud™ domains, in your organization or related organizations.

Authentication and authorization for these private endpoints is provided automatically. You browse available services and select one, rather than copying and pasting a URL. For more information on TIBCO Cloud Mesh, see the TIBCO Cloud Mesh topic in the TIBCO Subscriber Cloud documentation.

Before you begin
Note: Before you can use the TIBCO Cloud™ Mesh service, you must connect to TIBCO Cloud™. For information, see Connecting to TIBCO Cloud.
To use this feature, perform the following steps:
    Procedure
  1. Open the Cloud Applications view. (See note above if you have not yet connected to TIBCO Cloud™.)
  2. Under the Applications section, find the TIBCO Cloud Mesh Services section.
  3. Expand the section to view the services available to you. If your organization has related (parent or child) organizations, the screen displays all the related organizations as folders containing the services. Applications with Private endpoints (required to display the applications) are listed in the TIBCO Cloud Mesh Services in the Cloud Servers view.

  4. Right-click the mesh service and select Import.

  5. In the Import API dialog, select Import to project.
  6. Click Browse.

  7. Select a folder or project and click OK.

  8. In the Import API screen, do not click Finish. Instead, click Next.

  9. On the Change Swagger name screen, enter a logical, unique name for the Swagger file. The default pre-generated name tends to be too long and include random characters.
  10. Click Finish.
    The TIBCO Cloud Mesh service descriptor files (including the API files) are displayed in the Project Explorer section.

  11. Drag and drop the mesh service from the Project Explorer to the application's Process window and select Create Reference from the resulting dropdown menu.
    The service icon is added to the application project window.

HTTP Client Resource

All reference bindings that use TIBCO Cloud™ Mesh are preconfigured to use a single, special HTTP client resource, called TIBCOCloudMeshServices. This resource cannot be changed in the reference binding.

Select the TIBCOCloudMeshServices.httpClientResource in the Project Explorer tree.

The Default Host field is automatically populated with the default value: INTERCOM_HOST. This value is a constant and cannot be changed.

To verify and run the newly created client, either use Studio Debugger to debug the client application (the debugger securely connects to the service running in the cloud and returns the output), or push the client application to the cloud and scale it up.

Note: To run or debug the client application in TIBCO Business Studio for BusinessWorks, ensure that in the Advanced tab, the Enable TIBCO Cloud Mesh Services Consumer checkbox is selected.

Single Sign On: After selecting the Enable TIBCO Cloud Mesh Services Consumer the checkbox, you can connect to the default cloud server mentioned in the ssoConfig.properties file.

REST Service Binding

When you create a REST service binding, TIBCO Business Studio generates a default name Resource and a default path /resource for the service. When deployed to TIBCO Cloud Integration, these names appear in the generated Swagger metadata for the endpoint. If left unchanged, all services deployed in this way appear indistinguishable in TIBCO Cloud Mesh. Therefore, it is a good idea to immediately give any new service binding a more specific name and path.

Note: If you are using TIBCO Cloud™ Mesh, you have an attribute Service App ID for reference binding in TIBCO Business Studio™. So in case the service application is changed and the new application also has the same mesh point. You can always provide the new application ID and the client application works fine.