Application programs in the Go language differ in several ways from programs in other languages. These steps outline the main structural components of most Go application programs that communicate using TIBCO FTL.
Summary of Differences
- Go does not support FTL timer events.
- Queue objects do not require explicit dispatch.
- Subscribe calls are methods of event queue objects, and these methods automatically add the new subscriber objects to the queue.
- When an inbound message arrives, the queue places the message on a subscriber channel, where your message processing methods can receive it.
- FTL inline mode is not relevant to Go programs.
Procedure
Task A
Initializing TIBCO FTL Objects
-
Create a realm object by connecting to an FTL server.
Task B
Processing Events
-
Create channels for inbound messages, and define goroutines to process messages from those channels.
-
Create channels for advisory messages, and define goroutines to process advisories, as needed.
-
Create a channel for out-of-band notifications, and define a goroutine to process notifications.
-
Launch the goroutines that poll message channels.
Task C
Sending Messages
-
Define structs for marshaling data to and from messages.
-
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 during message processing, or both.
Task D
Receiving Messages
-
Create an event queue object.
-
Create subscriber objects.
Supply a channel as an argument. (The goroutines that process messages on the channel are already running.)
With a durable, supply a name property.
Task E
Recovery and Clean-Up
-
Recover from administrative disable (see
Recovery of a Disabled Process Restart versus Reopen the Realm).
-
Exit cleanly (see
Clean-Up).
Copyright © Cloud Software Group, Inc. All rights reserved.