Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Adapter Program Elements : Transport Protocol

Transport Protocol
TIBCO Adapter SDK allows custom adapters to use a publish/subscribe or a request/reply transport protocol. This section gives an overview of both protocols. See Chapter 7, TIBCO ActiveEnterprise Operation Model for more information about request/reply (client/server) interactions.
Publish/Subscribe Protocol
Publish/subscribe interactions are driven by events such as the arrival of data or a timer signaling that a specified interval has elapsed.
Adapter Publisher
A publisher gets information from a source application, for example, an ERP (Enterprise Resource Planning) application, and makes it available (publishes it) to the transport, directly or through an intermediary.
Figure 5 Adapter Publisher
Adapter Subscriber
A subscriber receives information from the transport and passes it on to a target application.
Figure 6 Adapter Subscriber
In publish/subscribe interactions, data producers (publishers) are decoupled from data consumers (subscribers), that is, they do not coordinate data transmission with each other. Information is routed to the appropriate consumer because that consumer has subscribed to all messages with the matching destination.
Request/Reply Interactions
Demand for data drives request/reply (client/server) interactions. A client requests data from a server; the server computes an individual response and returns it to the client. Communication flows in both directions, as illustrated in Figure 7. The complete interaction consists of two point-to-point messages—a request and a reply.
Figure 7 Demand-Driven Request/Reply Interactions
Request/Reply Basics
Demand-driven computing is well-suited for distributed applications that require point-to-point messages. In request/reply interactions, data producers coordinate closely with data consumers. A producer does not send data until a consumer makes a request.
The server sends replies to the client that requested the data. The client listens until it receives the reply, and then stops listening (unless it expects further installments of information).
Request/reply interactions can be implemented in two ways:
MPublisher and MSubscriber have facilities to implement request/reply.
Request/Reply and Reply Destinations
To perform request/reply interactions and set your own reply destination, do the following:
1.
Call the MPublisher method setReplyDestination() to specify the reply subject.
2.
Create the MSubscriber(s) listening on the reply subject.
3.
Call the MPublisher method send() to send the message.
Note that the MPublisher method sendWithReply() is not suited for this approach because it is always point-to-point.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved