Subscribers and Message Interest

The roles of a subscriber object in TIBCO FTL are different from the roles of a subscriber in TIBCO EMS. FTL subscriber objects express interest in a stream of messages, and act as the receiving end of a transport bus, and enqueues inbound messages for processing. However, unlike EMS subscribers, FTL subscribers do not actually process the information in messages.

Express Interest

FTL programs express interest in a stream of messages by creating a subscriber object on an endpoint. The create subscriber call accepts a content matcher argument, which specifies that message interest. After the subscriber object establishes its transport bus, the subscriber and the bus use the matcher to filter the stream of inbound messages. The resulting effect is that the subscriber object receives a stream of messages with content that matches the content matcher.

A subscriber with a null content matcher expresses interest in all messages published on the transport bus, without any filtering.

Establish a Transport Bus

Before any inbound messages can flow, a subscriber object must first establish a transport bus to carry messages. This low-level role can include protocol interactions and constructing internal machinery, all of which is invisible to application programs. Configuration data from the FTL server guides the subscriber in this role.

After the transport bus begins operating, the subscriber object repeatedly cycles through the following three message delivery phases.

Phase 1: Receive

A subscriber object receives a stream of inbound messages from its transports. This low-level role can include I/O operations and reassembling data into messages, all of which is transparent to application programs.

Phase 2: Match and Filter

A subscriber object uses its content matcher locally to test the content of each inbound message.

Notice that the program supplied the content matcher when it created the subscriber, and FTL software uses it repeatedly to automatically filter the message stream.

Phase 3: Distribute

A subscriber object distributes the filtered stream of inbound messages, that is, it places each message on an event queue.

This action concludes the subscriber's delivery responsibilities with respect to an individual message. Phases four, five, and six of message delivery are the responsibility of the application program. (See the topics that follow.)

The subscriber's role resumes with the receive phase, when another message arrives through the transport bus.

(For precise definitions of all six phases of delivery, see "Inbound Message Delivery" in TIBCO FTL Development.)

Key Points for Developers

  • A program creates a subscriber object and supplies it with a content matcher.
  • The content matcher specifies the subscriber's message interest, which determines the sub-stream of messages that the subscriber object receives.

Differences

  • The roles of a subscriber are not entirely parallel between FTL and EMS. You cannot infer the behavior of one from the other.
  • EMS programs can use either subscribers or consumers to receive messages.

    FTL programs use only subscribers. (Consumers do not exist as a separate concept in FTL.)

  • EMS and FTL use the word interest to denote two separate concepts.

    In FTL, every subscriber expresses message interest.

    In EMS, the concept of interest is associated with routers and bridges.

  • The filtering role of FTL content matchers is similar to that of EMS message selectors. However, their behavior is not similar. For more details, see Content-Based Addressing.