TIBCO FTL®
|
Publisher objects send messages. More...
Macros | |
#define | TIB_PUBLISHER_PROPERTY_BOOL_RELEASE_MSGS_TO_SEND "com.tibco.ftl.client.publisher.release" |
Ownership of outbound messages; boolean. More... | |
#define | TIB_PUBLISHER_PROPERTY_DOUBLE_PERSISTENCE_CLOSE_LINGER "com.tibco.ftl.client.publisher.persistence.close.linger" |
Linger duration for persistent publisher close operation; double. More... | |
#define | TIB_PUBLISHER_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION "com.tibco.ftl.client.publisher.persistence.retry.duration" |
Retry duration for persistent publisher operations; double. More... | |
#define | TIB_PUBLISHER_PROPERTY_INT_MAX_BATCH_COUNT "com.tibco.ftl.client.publisher.max.batch" |
Maximum batch count for non-inline publishers; integer. More... | |
#define | TIB_PUBLISHER_PROPERTY_INT_SEND_POLICY "com.tibco.ftl.client.publisher.send.policy" |
Publisher send policy; integer. More... | |
#define | TIB_PUBLISHER_PROPERTY_STRING_LABEL "com.tibco.ftl.client.publisher.label" |
Property name for a publisher label; string. More... | |
#define | TIB_PUBLISHER_PROPERTY_STRING_REPLY_ENDPOINT "com.tibco.ftl.client.publisher.reply.endpoint" |
Property name for a publisher reply endpoint; string. More... | |
Typedefs | |
typedef struct __tibDirectPublisherId * | tibDirectPublisher |
typedef struct __tibPublisherId * | tibPublisher |
A publisher object realizes the message-sending functionality of an endpoint within a program. More... | |
Enumerations | |
enum | tibPublisher_SendPolicy { TIB_PUBLISHER_SEND_INLINE = 0 , TIB_PUBLISHER_SEND_NON_INLINE = 1 } |
Functions | |
TIB_API void | tibDirectPublisher_Close (tibEx e, tibDirectPublisher publisher) |
Close a direct publisher. More... | |
TIB_API tibDirectPublisher | tibDirectPublisher_Create (tibEx e, tibRealm realm, const char *endpointName, tibProperties props) |
Create a direct publisher. More... | |
TIB_API tibint8_t * | tibDirectPublisher_Reserve (tibEx e, tibDirectPublisher publisher, tibint64_t count, tibint64_t totalSize, tibint64_t **sizeArray) |
Reserve a memory buffer for direct publishing. More... | |
TIB_API void | tibDirectPublisher_SendReserved (tibEx e, tibDirectPublisher publisher) |
Send the data in the reserved buffer. More... | |
TIB_API void | tibPublisher_Close (tibEx e, tibPublisher publisher) |
Close a publisher. More... | |
TIB_API tibPublisher | tibPublisher_Create (tibEx e, tibRealm realm, const char *endpointName, tibProperties props) |
Create a publisher. More... | |
TIB_API void | tibPublisher_Flush (tibEx e, tibPublisher publisher) |
When the publisher's send policy is non-inline, flush all outsanding messages. More... | |
TIB_API int | tibPublisher_GetMaxBatchCount (tibEx e, tibPublisher pubisher) |
Returns the maximum batch count of a non-inline publisher. More... | |
TIB_API tibPublisher_SendPolicy | tibPublisher_GetSendPolicy (tibEx e, tibPublisher publisher) |
Returns the send policy of a publisher. More... | |
TIB_API void | tibPublisher_Send (tibEx e, tibPublisher publisher, tibMessage msg) |
Send a message, one-to-many. More... | |
TIB_API void | tibPublisher_SendMessages (tibEx e, tibPublisher publisher, tibint32_t msgCount, tibMessage *msgs) |
Send an array of messages, one-to-many. More... | |
TIB_API void | tibPublisher_SendReply (tibEx e, tibPublisher publisher, tibMessage reply, tibMessage request) |
Send a reply message to a requester. More... | |
TIB_API tibMessage | tibPublisher_SendRequest (tibEx e, tibPublisher publisher, tibMessage request, tibdouble_t timeout) |
Send a request and wait for reply. More... | |
TIB_API void | tibPublisher_SendToInbox (tibEx e, tibPublisher publisher, tibInbox inbox, tibMessage msg) |
Send an inbox message. More... | |
Publisher objects send messages.
This file defines publisher objects and calls that send messages.
#define TIB_PUBLISHER_PROPERTY_BOOL_RELEASE_MSGS_TO_SEND "com.tibco.ftl.client.publisher.release" |
Ownership of outbound messages; boolean.
When tibfalse
or absent, client program code retains ownership of outbound messages that it sends through this publisher.
When tibtrue
, the FTL library accepts ownership of outbound messages that the client sends through this publisher. Client code releases the message object when it invokes the send call; from that moment onward, client code must not reference the message object, because the FTL library can destroy the message object at any time.
Client code can release a message only if client owns the message. In particular, if a subscriber does not release its messages to the callback, then the callback must not send it through a publisher that releases messages. (See TIB_SUBSCRIBER_PROPERTY_BOOL_RELEASE_MSGS_TO_CALLBACK .)
#define TIB_PUBLISHER_PROPERTY_DOUBLE_PERSISTENCE_CLOSE_LINGER "com.tibco.ftl.client.publisher.persistence.close.linger" |
Linger duration for persistent publisher close operation; double.
When a persistence publisher is configured for non-inline send, and a call to tibPublisher_Close is made while there are still messages waiting to be persisted, the call can be configured to wait for some time before closing the publisher. If the linger period elapses, and the messages have not been successfully persisted, the messages will be discarded. Set this property to control the linger behavior of tibPublisher_Close . The default value is 30 seconds.
Values:
Closing the realm supersedes and cancels linger behavior.
#define TIB_PUBLISHER_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION "com.tibco.ftl.client.publisher.persistence.retry.duration" |
Retry duration for persistent publisher operations; double.
When tibPublisher_Create, tibPublisher_Send, or tibPublisher_SendMessages cannot access the persistence server (usually because of network failure or quorum unavailability), they can automatically retry the interaction. The value of this property overrides the retry behavior of the server. Supply it to the publisher create call.
Values:
Closing the publisher or the realm supersedes and cancels retry behavior.
#define TIB_PUBLISHER_PROPERTY_INT_MAX_BATCH_COUNT "com.tibco.ftl.client.publisher.max.batch" |
Maximum batch count for non-inline publishers; integer.
When a persistence publisher is configured for non-inline send, this is the maximum number of messages that may be in flight to the persistence service at any given time. When this limit is reached, tibPublisher_Send blocks until some messages can be persisted, or a failure occurs. The default value is 100.
The tibPublisher_GetMaxBatchCount call returns the value currently in effect.
#define TIB_PUBLISHER_PROPERTY_INT_SEND_POLICY "com.tibco.ftl.client.publisher.send.policy" |
Publisher send policy; integer.
Optimize the publisher for lower latency or greater throughput. The default behavior depends on the realm configuration.
Values:
When publishing to a store, and the administrator has configured publisher mode store_confirm_send for the store, the inline send policy causes tibPublisher_Send and tibPublisher_SendMessages to block until the message(s) have been successfully persisted, or until a failure occurs.
When publishing to a store, and the administrator has configured publisher mode store_confirm_send for the store, the non-inline send policy changes the behavior of tibPublisher_Send .
The tibPublisher_GetSendPolicy call returns the value currently in effect.
#define TIB_PUBLISHER_PROPERTY_STRING_LABEL "com.tibco.ftl.client.publisher.label" |
Property name for a publisher label; string.
It is good practice to include this property in every publisher create call. Monitoring data incorporates these labels so administrators can identify and distinguish among publishers. Use labels that reveal the unique role and identity of each publisher within the application program.
If a non-inline persistence publisher fails to persist a message, the resulting advisory will include the publisher label. See TIB_ADVISORY_NAME_NONINLINE_SEND_LOSS .
#define TIB_PUBLISHER_PROPERTY_STRING_REPLY_ENDPOINT "com.tibco.ftl.client.publisher.reply.endpoint" |
Property name for a publisher reply endpoint; string.
For tibPublisher_SendRequest this specifies the endpoint on which the reply is received.
typedef struct __tibDirectPublisherId* tibDirectPublisher |
typedef struct __tibPublisherId* tibPublisher |
A publisher object realizes the message-sending functionality of an endpoint within a program.
A publisher object encapsulates all the information that a program needs to send a stream of messages. Publisher objects use the transport and format resources associated with an endpoint (as defined in the realm).
Programs can use a publisher to send messages one-to-many, or one-to-one.
Enumerator | |
---|---|
TIB_PUBLISHER_SEND_INLINE | Publish with low latency; integer. |
TIB_PUBLISHER_SEND_NON_INLINE | Publish with high throughput; integer. |
TIB_API void tibDirectPublisher_Close | ( | tibEx | e, |
tibDirectPublisher | publisher | ||
) |
Close a direct publisher.
Closing a direct publisher invalidates all subsequent method calls, and forces any blocked reserve calls to return.
However, closing a direct publisher does not free its memory. For more information, see "Programming with Direct Publishers" in TIBCO FTL Development.
e | The exception object captures information about failures. |
publisher | The call closes this direct publisher. |
TIB_API tibDirectPublisher tibDirectPublisher_Create | ( | tibEx | e, |
tibRealm | realm, | ||
const char * | endpointName, | ||
tibProperties | props | ||
) |
Create a direct publisher.
Applications use direct publisher objects to send data buffers with low latency.
For a complete explanation, including best practices, see "Direct Publishers and Subscribers" in TIBCO FTL Development.
e | The exception object captures information about failures. |
realm | The realm object is the source of configuration information about the application, endpoints, and transports. |
endpointName | The endpoint identifies the publisher's data stream within the realm. |
props | Reserved for future use. To ensure forward compatibility, programmers must supply NULL . |
NULL
. TIB_API tibint8_t * tibDirectPublisher_Reserve | ( | tibEx | e, |
tibDirectPublisher | publisher, | ||
tibint64_t | count, | ||
tibint64_t | totalSize, | ||
tibint64_t ** | sizeArray | ||
) |
Reserve a memory buffer for direct publishing.
This call reserves two blocks of memory: a data buffer and a size array. The application can fill the memory buffer with one or more data values, and fill the size array with the corresponding sizes (in bytes) of the data values. (In the special case that the application indicates only one data value, this call does not reserve a size array.)
A direct publisher can reserve only one buffer at a time. Subsequent reserve calls in other threads block until the application sends the reserved buffer.
After calling reserve, the application must send the reserved buffer before calling reserve again within the same thread.
To avoid blocking, which increases latency, send the buffer soon after reserving it.
The data buffer and the size array belong to the library.
e | The exception object captures information about failures. |
publisher | The call reserves memory in this publisher. |
count | The application will write this number of data items into the data buffer. The call reserves a size array of this length. Supply a positive integer. |
totalSize | The call reserves a data buffer of this size (in bytes). |
sizeArray | The call also reserves a size array, and stores the address of that array in this pointer argument. The application will fill the array with the sizes of the data values. If count is 1, indicating a single data item, supply NULL . |
TIB_API void tibDirectPublisher_SendReserved | ( | tibEx | e, |
tibDirectPublisher | publisher | ||
) |
Send the data in the reserved buffer.
This call makes the data available to direct subscribers.
After this call returns, the publisher can reserve another buffer.
e | The exception object captures information about failures. |
publisher | The call sends the reserved buffer of this publisher. |
TIB_API void tibPublisher_Close | ( | tibEx | e, |
tibPublisher | publisher | ||
) |
Close a publisher.
Closing a publisher releases all the resources associated with it (for example, transport resources that are not used in other endpoints).
e | The exception object captures information about failures. |
publisher | The call closes this publisher. |
TIB_API tibPublisher tibPublisher_Create | ( | tibEx | e, |
tibRealm | realm, | ||
const char * | endpointName, | ||
tibProperties | props | ||
) |
Create a publisher.
Applications use publisher objects to send messages.
e | The exception object captures information about failures. |
realm | The realm object is the source of configuration information about the application, endpoints, transports and formats. |
endpointName | The endpoint identifies the publisher's data stream within the realm. To use the default endpoint, supply NULL . |
props | Optional. NULL to omit.Persistence properties: Message ownership property: Other properties: |
NULL
. TIB_API void tibPublisher_Flush | ( | tibEx | e, |
tibPublisher | publisher | ||
) |
When the publisher's send policy is non-inline, flush all outsanding messages.
When a persistence publisher is configured for non-inline send, calls to tibPublisher_Send may return before the message is persisted. Applications may call this function to ensure that all outstanding messages have been persisted (for example, if the application intends to close the publisher). This function blocks until all messages have been persisted, or until a failure occurs. If a failure occurs, this call will raise an exception.
e | The exception object captures information about failures. |
publisher | The call flushes messages previously sent using this publisher. |
TIB_API int tibPublisher_GetMaxBatchCount | ( | tibEx | e, |
tibPublisher | pubisher | ||
) |
Returns the maximum batch count of a non-inline publisher.
Returns the maximum batch count that is in effect for this publisher. Applications may use this call to determine appropriate behavior if a non-inline persistence publisher fails to persist a message.
See TIB_PUBLISHER_PROPERTY_INT_MAX_BATCH_COUNT
e | The exception object captures information about failures. |
publisher | The publisher. |
TIB_API tibPublisher_SendPolicy tibPublisher_GetSendPolicy | ( | tibEx | e, |
tibPublisher | publisher | ||
) |
Returns the send policy of a publisher.
Returns the send policy that is in effect for this publisher. Applications may use this call to determine appropriate behavior if a persistence publisher fails to persist a message.
See TIB_PUBLISHER_PROPERTY_INT_SEND_POLICY
e | The exception object captures information about failures. |
publisher | The publisher. |
TIB_API void tibPublisher_Send | ( | tibEx | e, |
tibPublisher | publisher, | ||
tibMessage | msg | ||
) |
Send a message, one-to-many.
If the administrator has configured publisher mode store_confirm_send for the store, a persistence publisher may block in this call until the message has been persisted. Otherwise the call returns immediately, and the message may or may not be stored.
For persistence publishers, the exact semantics depend on the send policy. See TIB_PUBLISHER_PROPERTY_INT_SEND_POLICY .
e | The exception object captures information about failures. |
publisher | The call sends the message using this publisher. |
msg | The call sends this message. |
TIB_API void tibPublisher_SendMessages | ( | tibEx | e, |
tibPublisher | publisher, | ||
tibint32_t | msgCount, | ||
tibMessage * | msgs | ||
) |
Send an array of messages, one-to-many.
The application sends each message in the array, in order.
Sending an array of messages eliminates the overhead cost of a separate call for each message.
If the administrator has configured publisher mode store_confirm_send for the store, a persistence publisher will block in this call until all messages have been persisted. Otherwise the call returns immediately, and the messages may or may not be stored.
e | The exception object captures information about failures. |
publisher | The call sends the messages using this publisher. |
msgCount | The number of messages provided in the array. |
msgs | The call sends msgCount messages from this array. |
TIB_API void tibPublisher_SendReply | ( | tibEx | e, |
tibPublisher | publisher, | ||
tibMessage | reply, | ||
tibMessage | request | ||
) |
Send a reply message to a requester.
Upon receiving a request message, send a reply message to the requester.
reply | The reply message. |
request | The original request message. |
TIB_API tibMessage tibPublisher_SendRequest | ( | tibEx | e, |
tibPublisher | publisher, | ||
tibMessage | request, | ||
tibdouble_t | timeout | ||
) |
Send a request and wait for reply.
Send a request and wait for a reply within a specified timeout.
request | The request message. |
timeout | The maximum time (in seconds) to wait for a reply. |
TIB_API void tibPublisher_SendToInbox | ( | tibEx | e, |
tibPublisher | publisher, | ||
tibInbox | inbox, | ||
tibMessage | msg | ||
) |
Send an inbox message.
Because inbox messages do not trigger the content matchers of other subscribers on the endpoint, they are an efficient way to target a message to a specific destination. For example, you might use an inbox message to query a specific data source, or to reply to a query.
For details about getting an inbox, see tibMessage_GetInbox
e | The exception object captures information about failures. |
publisher | The call sends the message using this publisher. |
inbox | The call sends the message to this inbox. |
msg | The call sends this message. |