Jump to content
The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now! See more information here ×

Quickstart on using the Flogo Connector for TIBCO Cloud Messaging


William Karasz

Recommended Posts

TIBCO Cloud Messaging provides the infrastructure for developing global applications quickly and easily. With simple to use client-side libraries you can develop secure, high performance mobile and web-based applications.

TIBCO Cloud Messaging uses a publish/subscribe model for real-time messaging between devices and web-based applications. Your clients can publish messages with any content, and subscribing clients will receive only those messages with which they have registered interest.

In this document, you will:

 

Create Pub and Sub flows in TCI (App Development in TCI)

 

Create a Pub flow in Flogo WebUI (App Development in Flogo WebUI)

 

 

 

App Development in TCI

Configure TCM Connector in TCI

Head over to https://cloud.tibco.com and open the Messaging hexagon.

 

Copy the wss:// url to the clipboard or record in a side document. Youll need this in the next step.

 

 

Navigate to the TCI hexagon >> Flogo apps, and click on Connections.

 

Select the TIBCO Cloud Messaging Connector:

 

Create Publisher App

Create a new flow and call it TCM Publisher

 

Add a TimerTrigger trigger to the flow and configure with a repeating interval.

 

Add a TCM Message Publisher activity:

 

On the Configuration tab, select your TCM Connector.

On the Input Settings tab, lets input the following JSON schema:

{

"id": "1234",

"payload": "ipsum lorem"

}

 

On the Input tab, provide values for the activity input. Here were using mydest as the destination.

 

Similarly, provide values for message.id and message.payload

 

Create Subscriber App

Create a new flow and call it TCM Subscriber.

 

Define the Flow Inputs and Outputs. Copy in the JSON schema from the publish activity, like so:

 

Add a TCM Message Subscriber trigger. Select your TCM connector and define the Destination as mydest.

 

On the Output Settings tab, input the same schema we used in the publish TCM activity.

 

On the Output tab, map the Trigger outputs to the Flow inputs. The screenshot below depicts the mapping for $flow.id. Do the same for $flow.payload.

 

Close the dialog window, and now add a LogMessage activity to the flow.

 

Echo the incoming message to the log with the following expression:

string.concat(Received payload: , $flow.payload, and ID: , $flow.id)

 

 

Deploy TCI Flogo App

To see the fruits of your labor, well push the app and review the app logs.

Navigate back to App level where you can see the Flows. Click on the Push app button.

 

After the application is started, click on the Log icon

 

App Development in Flogo WebUI

Create a new app

 

Select Microservice profile

 

Create a New Flow

 

Install a new activity >> github.com/jvanderl/flogo-components/activity/tcmpub

 

 

Now add the Send TCM Message to the Flow

 

Provide the activity inputs. Compared to the TCI App, there are three new fields clientid, destinationname, and messagename clientid is optional, while destinationname and messagename require you to provide the key name, not the value; that information will be provided in the aptly named destinationvalue and message value fields.

 

So here is probably why you are still reading this post, to post a message to a destination on TCM, define destinationvalue=_dest. Thats the magic value you need.

 

The only misgiving for this open source Flogo activity is that the messagename and messagevalue are simplistically defined; i.e. you can pass only one key/value element of data.

E.g. messagename = foo, messagevalue = bar, will result in the TCM payload { foo: bar}.

 

If you do fork the tcmpub activity and create your own TCM Pub activity, please be sure to update here, and wed be happy to update the documentation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...