Structuring Programs

These steps outline the main structural components of most application programs that communicate using TIBCO FTL.

Note: For Go program structure, see Structuring Programs in Go.

Procedure

Task A Initializing TIBCO FTL Objects

  1. Create a realm object by connecting to an FTL server. (C programs must first open the top-level FTL object, and then a realm object.)

Task B Defining Callbacks

  1. Define callbacks to process inbound messages.
  2. Define callbacks to process advisory messages, as needed.
  3. Define callbacks to handle out-of-band notifications.
  4. Define callbacks for timer events, timer completion, and queue completion, as needed.

Task C Sending Messages

  1. Define methods to construct outbound messages.
  2. Instantiate endpoints as publisher objects.
  3. Arrange to call the send methods of publishers.

    Programs usually call send methods in the context of a data-generation loop, or in the context of message callbacks, or both. (You can use timer callbacks to implement a data-generation loop.)

Task D Receiving Messages

  1. Instantiate endpoints as subscriber objects. (With a durable, supply a name property.)
  2. Create event queues, and add each subscriber to an event queue.
  3. Start a loop to dispatch event queues.

Task E Recovery and Clean-Up

  1. Recover from administrative disable (see Recovery of a Disabled Process Restart versus Reopen the Realm).
  2. Exit cleanly (see Clean-Up).