Adapter for Apache Kafka 9.6 | webMethods Adapter for Apache Kafka Documentation | webMethods Adapter for Apache Kafka Installation and User’s Documentation | Adapter Services | Configuring Select Services
 
Configuring Select Services
A Select service retrieves specified information from a stream or a table. You configure Adapter for Apache Kafka services using Designer. For more information about adapter services, see Using Adapter Services.
Be sure to review the section Before Configuring or Managing Adapter Services before you configure adapter services.
*To configure a Select service
1. In Designer, right-click the package in which the service should be contained and select New > Adapter Service.
2. Select the parent namespace, type a name for the adapter service, and click Next.
3. Select Adapter for Apache Kafka as the adapter type and click Next.
4. Select the appropriate KSQL connection as Adapter Connection Name and click Next.
5. From the list of available templates, select the Select template and click Finish.
The adapter service editor for the adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name, Adapter Connection Name, and Adapter Service Template, as necessary.
6. Select the From tab to configure streams or tables using the following fields:
Field
Description/Action
Alias
The alias for table or stream is assigned automatically when you select more than one table in the Name field. The default value is t1.
Note:
There cannot be more than two tables. It can be a combination of one stream and one table.
Name
Select a table or a stream name.
Type
Displays the type of source you select, that is, table or stream.
7. If you are not joining tables or streams, skip this step. Select the JOIN tab to specify the columns for joining the tables you just configured.
a. Select the icon to create new left columns.
b. Select Left Column and select the first table's joining column.
c. Select the appropriate Operator.
d. Select Right Column and select the next table's joining column.
e. When you join two streams, WITHIN must be specified.
Use the following fields:
Field
Description/Action
WITHIN Type
Fixed or Interval.
If you select Fixed as WITHIN Type, then the 'within' type integer will appear under input parameters of the service. This is equivalent to WITHIN N Timeunit.
If you select Interval as WITHIN Type, then the 'within' type document will have before and after runtime parameters. This is equivalent to WITHIN(before Timeunit, after Timeunit).
WITHIN Timeunit
The time unit for the window. Valid values like DAY, DAYS, HOUR, HOURS, SECONDS and so on.
8. Use the SELECT tab to define the columns and fields to be selected as follows:
a. Use the icon to create new rows as needed. You can use the icon to fill in all rows to the table.
b. As you insert additional rows, the corresponding Column, Column Type, Output Field Type, and Output Field display for each column you select in the Column field.
Use the following fields:
Field
Description/Action
Column
The column name in the table or stream.
Column Type
The column data type defined in the table or stream.
Output Field Type
The data type of the output field. Adapter for Apache Kafka automatically converts table or stream-specific types to Java data types.
Output Field
The name of the field containing the output from the SELECT operation. An output field name displays when you select an expression. You can also modify the output field names as required.
LIMIT
Specifies the number of records to retrieve from the streams or tables. The default value is 1.
Note:
$limit overrides the design time depending on the given limit value. The service execution continues until the specified number of records are retrieved.
GROUP BY
Selects the column in which GROUP BY needs to be applied.
WINDOW
The type of window for the SELECT query such as SESSION, HOPPING, and TUMBLING.
Window Time Unit
The time unit for the window. Valid values like DAY, DAYS, HOUR, HOURS, SECONDS and so on.
9. Use the WHERE tab to specify the conditions for selecting information:
a. Select the icon to define new WHERE clause fields.
b. Select a logical operator from the AND/OR field, an Operator, and separators (the left and right parentheses) as needed, and specify values for the following fields:
Field
Description/Action
AND/OR
The logical operator.
Column
The name of the column you want to use in the WHERE clause.
Operator
The operator used with the Column and Input Field.
Input Field
The default value is ?, that acts as a placeholder for the variable so that you can set the input variable for that column at run time, or get input external to this adapter service. You can also type a fixed value in this field now or at run time. If you type a fixed value, be sure that it is valid, or an exception will be generated at run time.
The adapter automatically generates values for the following fields:
Field
Description
Parameter
The number of the inserted row.
Column (second occurrence of this field)
The name of the column you want to use in the WHERE clause.
Input Field Type
The corresponding input field's Java type.
Input Field (second occurrence of this field)
The name of the input field. By default the name combines the values of the Parameter and Column fields. However, you can also specify a custom value.
c. If necessary, use the or icons to change the order of the WHERE clause to ensure the parameters are parsed in the correct order.
d. Repeat this procedure until you have specified all WHERE parameters.
10. From the File menu, select Save.