TIBCO Adapter SDK C++ Reference
MPublisher::sendWithReply
MPublisher
Publish a message. This method works with both synchronous and asynchronous sessions.

The data is in MTree format. The application itself is responsible for converting data to MTree format. When the reply is sent, the SDK informs the listener specified by pEventListener.

The SDK serializes the MTree so its format is suitable for network transmissions.

Note
This method creates an inbox and its associated subscriber and links it to the caller in the last parameter. It supersedes any reply subject set by the user.

If you want to set a reply subject and broadcast replies to other subscriber, use the methods MPublisher::setReplyDestinationName() and MPublisher::send() instead.

Remarks
This method is useful in an adapter that implements a request-reply protocol. However, it processes only one reply message at a time.

If a call to this method fails, the publisher signals an exception.

The publisher explicitly has to delete the subscription passed in as an MSubscriber pointer.

If the message is sent over CM transport then the reply message is not certified.

If you use this method, the reply is sent point to point. In contrast, the reply is broadcast if you use send() and setReplySubject().

Parameters
Parameters Description
const MTree & rMTree Pointer to the MTree instance that the publisher will send to TIBCO Rendezvous.
MEventListener * pEventListener Pointer to the event listener that will be informed when the reply is received.
MSubscriber * & pSubscriber MSubscriber pointer passed to the method which is used to instantiate a reply subscription object. Note that each time you call this method by reference, the SDK creates a new subscription object. The publisher should delete this object when the reply is no longer expected.
Exceptions
MException is thrown when the underlying transport fails to send the data.
Declaration
void sendWithReply(const MTree & rMTree, MEventListener * pEventListener, MSubscriber * & pSubscriber) throw(MException);
Links
Copyright (c) 2010 TIBCO Software Inc. All rights reserved.