Subscribers express interest to receive inbound messages.
This file defines subscriber objects and calls that manipulate them.
#define TIB_SUBSCRIBER_PROPERTY_BOOL_RELEASE_MSGS_TO_CALLBACK "com.tibco.ftl.client.subscriber.release" |
Ownership of inbound messages; boolean.
When tibfalse
or absent, the FTL library retains ownership of inbound messages that arrive through this subscriber. The library automatically destroys each message after the callback returns.
When tibtrue
, client program code accepts ownership of inbound messages that arrive through this subscriber. The FTL library releases the message object when it dispatches the message to the client's callback. The callback can pass this message to another program thread. Client program code must explicitly destroy the message object.
#define TIB_SUBSCRIBER_PROPERTY_DOUBLE_PERSISTENCE_RETRY_DURATION "com.tibco.ftl.client.subscriber.persistence.retry.duration" |
Retry duration which persistent subscriber operations; double.
When tibSubscriber_Create or tibMessage_Acknowledge 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 subscriber create call.
Values:
-
0 No retry. The call raises an exception.
-
-1 Synchronously retry the interaction until it succeeds. The call returns only upon success.
-
n (Any positive double value) Retry the interaction for n seconds. Return upon success or raise an exception after timeout.
Closing the subscriber or the realm supersedes and cancels retry behavior.
#define TIB_SUBSCRIBER_PROPERTY_LONG_PREFETCH_SIZE "com.tibco.ftl.client.subscriber.prefetch.size" |
Allows a subscriber to override the prefetch set by the administrator for a static durable or dynamic durable template.
When absent
, the FTL library will default the prefetch value set by the administrator for a static durable or dynamic durable template.
When present
and set to a value greater than zero, a subscriber receives prefetch number of messages in a batch as set by the subscriber. NOTE: This value should be lower than the administrator configured value.
#define TIB_SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME "com.tibco.ftl.client.durable.name" |
Durable name property; string.
To request messages from a persistence store, supply a durable name as the value of this property in a tibSubscriber_Create call.
If a static or dynamic durable with this name already exists, the new subscriber draws messages from that durable.
Otherwise, the store creates a new dynamic durable with this name.
If this property is present, it overrides the TIB_SUBSCRIBER_PROPERTY_STRING_NAME property.
#define TIB_SUBSCRIBER_PROPERTY_STRING_KEY_FIELD_NAME "com.tibco.ftl.client.subscriber.keyfieldname" |
Key field name for a dynamic last-value durable; string.
When creating or subscribing to a dynamic last-value durable, this property is required. Supply the name of the last-value durable's key field as the value of this property.
The subscriber's content matcher must match the key field against a specific value.
#define TIB_SUBSCRIBER_PROPERTY_STRING_NAME "com.tibco.ftl.client.subscriber.name" |
Static durable subscriber name property; string.
To request messages from static durable in a persistence store, programs may supply a subscriber name as the value of this property in a tibSubscriber_Create call.
If TIB_SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME is present, it overrides this property.
If neither this property nor TIB_SUBSCRIBER_PROPERTY_STRING_DURABLE_NAME is present, then the create call uses the default durable subscriber name (_default
).
Setting this value is required for only static durables where administrative configuration maps the subscriber name to a durable name.
Direct subscriber callback.
Programs define callbacks of this type to process data buffers inbound to direct subscribers. tibDirectSubscriber_Dispatch invokes the callback.
The callback must unpack the data buffer. When the callback returns, the direct subscriber automatically acknowledges that it has received the buffer.
The data buffer and the size array belong to the library. Applications must not write into these objects, nor free them.
- Note
- The buffer, its data, and the size array are valid only until the callback returns. To extend the lifetime of the data, copy it to application memory.
- Parameters
-
e | The exception object captures information about failures. |
count | The number of data items in the data buffer. |
totalSize | The size of the data buffer (in bytes). |
sizeArray | An array of sizes corresponding to the count data items in the buffer. |
data | The data buffer. |
closure | A closure object. The direct subscriber receives this object in the dispatch call, and passes it unchanged to the callback. The callback may modify it. |
Close a direct subscriber.
Closing a direct subscriber invalidates all subsequent method calls, and forces any blocked dispatch calls to return.
However, closing a direct subscriber does not free its memory. For more information, see "Programming with Direct Subscribers" in TIBCO FTL Development.
- Parameters
-
e | The exception object captures information about failures. |
subscriber | The call closes this direct subscriber. |
- Returns
- void
Explicitly acknowledge a batch of messages.
When a durable subscriber object specifies explicit acknowledgement, the application program must acknowledge each message to the durable, the application can acknowledge each message individually by calling msg.acknowledge() or by calling this method with a batch of messages.
When a durable subscriber object does not specify explicit acknowledgement, the FTL library automatically acknowledges the message when the application callback method returns.
For any message that arrives through a non-durable subscriber, this call returns without error (and without action).
- Parameters
-
e | The exception object captures information about failures. |
subscriber | The subscriber for which we want to explicitly acknowledge messages. |
msgNum | The number of messages to acknowledge |
msgs | The array of messages to acknowledge |
- Returns
- void
- See also
- TIB_SUBSCRIBER_PROPERTY_BOOL_EXPLICIT_ACK
Create an inbox subscriber.
Applications use inbox subscriber objects to register interest in a stream of inbox messages.
A subscriber does not receive messages until you add it to an event queue.
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.
- Parameters
-
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 subscriber's data stream within the realm. To use the default endpoint, supply NULL . |
props | Optional. NULL to omit.
Message ownership property:
|
- Returns
- a new subscriber object