Create a Slack-based Apache Flink® table
With Aiven's Slack Connector for Apache Flink®, you can create sink tables in your Flink application and set up statements to send alerts and notifications to your designated Slack channel. This allows for real-time monitoring and tracking of your Flink job progress and any potential issues that may arise.
You can access the open-source Slack connect for Apache Flink on Aiven's GitHub repository at Slack Connector for Apache Flink®.
Prerequisites
- Slack app created and ready for use. For more information, refer to the Set-up Slack Application section on the GitHub repository and the Slack documentation.
- Note the channel ID and token value, as these will be required in the sink connector Table SQL when configuring the connection in your Flink application.
Configure Slack as sink for Flink application
To configure Slack as the target using the Slack connector for Apache Flink:
- In the Aiven for Apache Flink service page, select Application from the left sidebar.
- Create a application or select an existing application for your desired data service integration.
If you are editing an existing application, create new version of the application to make changes to the source or sink table.
- In the Add source tables screen, select the option to add a new source table, edit an existing one, or import a source table. Select your integrated service and in the Table SQL section, enter the statement that will be used to create the table.
- In the Add sink tables screen, select the option to add a new sink table or edit an existing one.
- In the Table SQL section, set the connector to slack and enter the necessary token as shown in the example below:
CREATE TABLE channel_name (
channel_id STRING,
message STRING
) WITH (
'connector' = 'slack',
'token' = '<TOKEN>'
)
* channel_id
should contain the channel ID parameter. * Replace the
\<TOKEN\>
placeholder with the token you created in Slack
during the prerequisites.
- Create the SQL statement to send notifications/alerts to the designated slack channel.
You can check the connection by running a query on the sink table. If the data flows into the slack channel, the connection is successful.