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
- Create a realm object by connecting to an FTL server. (C programs must first open the top-level
object, and then a realm object.)FTL - Define callbacks to process inbound messages.
- Define callbacks to process advisory messages, as needed.
- Define callbacks to handle out-of-band notifications.
- Define callbacks for timer events, timer completion, and queue completion, as needed.
- Define methods to construct outbound messages.
- Instantiate endpoints as publisher objects.
- 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.)
- Instantiate endpoints as subscriber objects. (With a durable, supply a name property.)
- Create event queues, and add each subscriber to an event queue.
- Start a loop to dispatch event queues.
- Recover from administrative disable (see Recovery of a Disabled Process Restart versus Reopen the Realm).
- Exit cleanly (see Clean-Up).
Task A
Initializing TIBCO FTL Objects
Task B
Defining Callbacks
Task C
Sending Messages
Task D
Receiving Messages
Task E
Recovery and Clean-Up