- Index

< Previous |  | Next >

# TIBCO FTL Acknowledge Adapter

## Introduction

The TIBCO StreamBase® Acknowledge Adapter for TIBCO FTL® allows a StreamBase application to explicitly acknowledge received FTL messages. The adapter is embedded in the StreamBase application and has one input port and one output port. The input port is used to receive the message ID of the message to acknowledge. The output port emits status tuples.

The adapter is configured through properties set in its Adapter Properties view in StreamBase Studio, described below.

### TIBCO Middleware Dependencies

This adapter requires access to the JAR file that implements the TIBCO FTL Java API on your system, and any files referenced by that JAR file. The adapter has been tested with FTL version 3.1, though it will likely work with newer FTL API versions as well. To make the TIBCO FTL Java API available to the adapter, you must supply a maven dependency for it. The FTL sample comes with a launch config which will install the `tibftl.jar` into your local maven repository.

The `tibftl.jar` file, in turn, relies on various native libraries, such as `tibftljni.dll` on Windows and `tibftljni.so` on Linux. As with `tibftl.jar`, these native libraries are supplied as part of your TIBCO FTL installation and are not shipped with StreamBase. Make sure to edit your `src/main/configurations/engine.conf` and make changes to reflect your current setup. Please see the FTL sample application for an example configuration.

## Adapter Properties

Property | Description
--- | ---
Message ID Field Name | REQUIRED. Name of the field that contains the ID of the message to acknowledge.
Log Level | Controls the level of verbosity the adapter uses to send notifications to the console. This setting can be higher than the containing application's log level. If set lower, the system log level is used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.
FTL Library Log Level | The log level used by the FTL library. Multiple FTL input and output adapter instances share the most verbose level configured in any adapter.

## Using the Adapter in a StreamBase Application

There are two ways to explicitly acknowledge a received message from FTL: Either use the TIBCO FTL Subscribing Input Adapter's `acknowledge` command or use an instance of the Acknowledge adapter. In either case, the field designated to contain the message ID (specified in the Message ID Field Name property) is expected to contain a valid message ID value. Upon receiving the command the message will be acknowledged and a status tuple will be emitted to indicate success or failure.

The TIBCO FTL Acknowledge Adapter's ports are used as follows:

- Control: This input port receives tuples used to acknowledge a given message. The Control port is expected to contain one string field, the name of which is specified in the adapter's Message ID Field Name property.

- AckStatus: This output port emits status, information, and error tuples. The Status port has the following schema:

  - type, string: Describes the type of event that occurred.

  - action, string: the action associated with the event, such as `Acknowledged` or `Failed`.

  - object, string: the message ID for the message to be acknowledged.

  - message, string: a human-readable message string

  - inputTuple, tuple: the tuple enqueued to the control port that led to the event, or null if the event was not related to processing an input tuple.

Add an instance of the adapter to a new StreamBase application as follows:

1. In StreamBase Studio, create a project, and create an EventFlow application file to host the adapter.

2. Drag an instance of the TIBCO FTL Acknowledge Adapter from the Operators and Adapter drawer in the Palette view to the canvas.

3. Select the adapter icon, and in the Properties view, fill in the adapter's Message ID Field Name property.

4. Connect an input streams to the adapter's input port and an output stream to its output port.

5. Configure the schema of Control input stream with a string field named after the value specified in step 3.

## Typechecking and Error Handling

The TIBCO FTL Acknowledge adapter uses typecheck messages to help you configure the adapter in your StreamBase application. In particular, the adapter generates typecheck errors when a required property has not been specified or the control input schema is missing a required field or it has the wrong data type.

The adapter generates messages on the status port during runtime under various conditions, including:

- An FTL message is acknowledged or the operation has failed.

- The adapter is suspended or resumed.

## Suspend and Resume Behavior

When suspended, the TIBCO FTL Acknowledge Adapter stops processing acknowledge commands.

When resumed, the adapter resumes processing acknowledge commands.

## Related Topics

- TIBCO FTL Subscribing Input Adapter

- TIBCO FTL Map Adapters