{"id":19693872,"url":"https://github.com/aiven-open/slack-connector-for-apache-flink","last_synced_at":"2025-06-24T10:10:25.106Z","repository":{"id":38373007,"uuid":"461866258","full_name":"Aiven-Open/slack-connector-for-apache-flink","owner":"Aiven-Open","description":"Apache Flink® connector for Slack","archived":false,"fork":false,"pushed_at":"2024-02-22T08:54:15.000Z","size":209,"stargazers_count":5,"open_issues_count":4,"forks_count":6,"subscribers_count":53,"default_branch":"main","last_synced_at":"2025-04-29T10:47:03.270Z","etag":null,"topics":["flink","flink-connector","slack"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aiven-Open.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-21T13:07:57.000Z","updated_at":"2024-10-04T16:09:36.000Z","dependencies_parsed_at":"2025-04-29T10:34:38.926Z","dependency_job_id":"69d8cac2-cfc9-448e-a755-90530dd1244c","html_url":"https://github.com/Aiven-Open/slack-connector-for-apache-flink","commit_stats":null,"previous_names":["aiven-open/slack-connector-for-apache-flink"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Aiven-Open/slack-connector-for-apache-flink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fslack-connector-for-apache-flink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fslack-connector-for-apache-flink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fslack-connector-for-apache-flink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fslack-connector-for-apache-flink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aiven-Open","download_url":"https://codeload.github.com/Aiven-Open/slack-connector-for-apache-flink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aiven-Open%2Fslack-connector-for-apache-flink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261649858,"owners_count":23189755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flink","flink-connector","slack"],"created_at":"2024-11-11T19:18:31.988Z","updated_at":"2025-06-24T10:10:25.082Z","avatar_url":"https://github.com/Aiven-Open.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Connector for Apache Flink®\n\n## Compatibility matrix\n\n| Apache Flink    | Slack Connector for Apache Flink | Release date |\n|-----------------|----------------------------------|--------------|\n| 1.14.x - 1.15.x | v1.0                             | 17.10.2022   |\n| 1.15.x          | v1.0.1-1.15                      | 16.11.2022   |\n| 1.16.x          | v1.0.1-1.16                      | 16.11.2022   |\n\nSince 1.0.1 versioning looks like `\u003cmajor\u003e.\u003cminor\u003e.\u003cpatch\u003e-\u003cflink-major\u003e.\u003cflink-minor\u003e` \naccording to [Externalized Connector development](https://cwiki.apache.org/confluence/display/FLINK/Externalized+Connector+development)\n\nTo start using Slack connector for Flink put `flink-slack-connector-\u003cversion\u003e.jar`\nto `lib/` folder of Flink and restart Flink.\n\n## Build locally\n```bash\n./mvnw clean verify -DskipTests\n```\nor in case of Windows\n```\nmvnw clean verify -DskipTests\n```\nTo build with tests it is required to define `SLACK_FOR_FLINK_BOT_TOKEN` and `SLACK_FOR_FLINK_CHANNEL_ID` env variables.\n`SLACK_FOR_FLINK_BOT_TOKEN` contains Bot User OAuth Token (see below)\n`SLACK_FOR_FLINK_CHANNEL_ID` contains a channel id used during unit tests\n\n## Set-up Slack Application\n\n1. Create your Slack app at [Slack API](https://api.slack.com/apps)\n2. In Oauth \u0026 Permissions in Scopes add `chat:write`\n3. In Oauth \u0026 Permissions copy `Bot User OAuth Token` and use for placeholder `BOT_USER_OAUTH_ACCESS_TOKEN`\n4. Reinstall the app\n5. Add app to the channel where it should post by mentioning the app name in a message (e.g. `@APP_NAME`) and confirming the invitation \n6. Collect the Channel Id by right clicking on the channel name -\u003e View Channel details and scrolling at the bottom of the window. The channel id should start with `C` and have a format similar to `CXXXXXXXXX` \n\n[Channel ID shown at the bottom of the window](/img/channel_id.png)\n\n## Send message\n\nMessages could be sent in plain text or formatted way. Also, messages could be sent as normal messages or as replies.\nTo send messages it is required that app has `chat:write` permission and bot is added to channel where a message should be post.\n\nFirst create table\n```sql\nCREATE TEMPORARY TABLE slack_example (\n    `channel_id` STRING,\n    `message` STRING \n) WITH (\n    'connector' = 'slack',\n    'token' = BOT_USER_OAUTH_ACCESS_TOKEN\n);\n```\nTo be able to send messages in a table there should be column with name `channel_id` and `message` (or `text`).\nNow to send a simple plain text message to channel_id `CHANNEL_ID`\n```sql\nINSERT INTO slack_example VALUES('CHANNEL_ID', 'Hello world!');\n```\n\n### Send message as reply\nTo send message as reply it is required to specify `thread` to reply.\n```sql\nCREATE TEMPORARY TABLE slack_example_with_reply (\n    `channel_id` STRING,\n    `thread` STRING,\n    `message` STRING \n) WITH (\n    'connector' = 'slack',\n    'token' = BOT_USER_OAUTH_ACCESS_TOKEN\n);\n```\nNow to reply a simple plain text message to thread `THREAD_ID` in channel_id `CHANNEL_ID`\n```sql\nINSERT INTO slack_example_with_reply VALUES('CHANNEL_ID', 'THREAD_ID', 'Hello world!');\n```\nIn case `THREAD_ID` is null it will be a normal message e.g.\n```sql\nINSERT INTO slack_example_with_reply VALUES('CHANNEL_ID', CAST(NULL AS STRING), 'Hello world!');\n```\n\n### Send formatted message\nTo send formatted message there should be `blocks_as_str` or `formatted` column\n```sql\nCREATE TEMPORARY TABLE slack_example_formatted (\n    `channel_id` STRING,\n    `thread` STRING,\n    `formatted` STRING \n) WITH (\n    'connector' = 'slack',\n    'token' = BOT_USER_OAUTH_ACCESS_TOKEN\n);\n```\nNow to send a formatted message to channel_id `CHANNEL_ID`\n```sql\nINSERT INTO slack_example_formatted VALUES('CHANNEL_ID', CAST(NULL AS STRING), '[{\"type\": \"divider\"}]');\n```\nAnd similar message replying to `THREAD_ID`\n```sql\nINSERT INTO slack_example_formatted VALUES('CHANNEL_ID', 'THREAD_ID', '[{\"type\": \"divider\"}]');\n```\n\nMore examples of formatted messages could be found at [block-kit-builder](https://app.slack.com/block-kit-builder)\n\nNote: in `formatted` there should be passed only value for `blocks`.\n\n## Source\nFor querying there are available `type`, `ts`, `user`, `text`, `team`, `thread_ts` columns.\nWhile querying it is also required to specify `channel_id` like \n```sql\nCREATE TEMPORARY TABLE table_for_quering (\n    `ts` DECIMAL(16, 6),\n    `channel` STRING,\n    `type` STRING,\n    `username` STRING,\n    `user` STRING,\n    `text` STRING \n) WITH (\n    'connector' = 'slack',\n    'token' = :BOT_TOKEN,\n    'channel_id' = :CHANNEL_ID\n);\n```\n\n## Common errors\n\nWhen creating a Flink job, the following are common error messages and related solutions:\n\n* ``not_in_channel``: The app has the right permissions, but is not invited in the channel where it should post. Mention the app name in a message (e.g. `@APP_NAME`) and confirm the invitation.\n\n\n## Trademarks\n\nApache Flink is either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.\n\nSlack is a trademark and service mark of Slack Technologies, Inc., registered in the U.S. and in other countries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiven-open%2Fslack-connector-for-apache-flink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faiven-open%2Fslack-connector-for-apache-flink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiven-open%2Fslack-connector-for-apache-flink/lists"}