When programming an eFTL application, use the steps of this task to guide the program structure.
Some programs require only a subset of these structural steps.
Procedure
Define Connection Callbacks
Every program must define the four ConnectionListener event methods:
Connect
Disconnect
Reconnect
Error
Define Subscription Callbacks
Programs that subscribe must define the three SubscriptionListener event methods:
Messages
Subscribe
Error
Define completion callbacks.
Programs that publish define the two CompletionListener event methods:
Completion
Error
Connect to an TIBCO eFTL Server
If the server uses TLS security, the application must register trust in the server’s certificate.
Every program must call the connect method to establish a connection.
You may include user name credentials in the
url argument. For syntax, see the API documentation. When using the WSS protocol, this information travels encrypted.
Sending Messages
Programs that publish must complete both of these substeps.
Construct outbound messages.
Call publish the method.
Receiving Messages
Programs that subscribe must call the subscribe method.
Clean-Up
Consider whether it is appropriate for the program to close subscriptions or durable subscriptions.
Every program must call the disconnect method to disconnect from the server.