Programming an eFTL Application

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

  1. Define Connection Callbacks
    Every program must define the four ConnectionListener event methods:
    • Connect
    • Disconnect
    • Reconnect
    • Error
  2. Define Subscription Callbacks
    Programs that subscribe must define the three SubscriptionListener event methods:
    • Messages
    • Subscribe
    • Error
  3. Define completion callbacks.
    Programs that publish define the two CompletionListener event methods:
    • Completion
    • Error
  4. Connect to an TIBCO eFTL Server
    1. If the server uses TLS security, the application must register trust in the server’s certificate.
    2. 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.
  5. Sending Messages

    Programs that publish must complete both of these substeps.

    1. Construct outbound messages.
    2. Call publish the method.
  6. Receiving Messages

    Programs that subscribe must call the subscribe method.

  7. 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.