Slack Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Receive messages from a Slack channel.
Configuration Options
The following table summarizes the configuration options available for the slack-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Channel | Required The Slack channel to receive messages from. | string | #myroom | ||
Token | Required The Bot User OAuth Access Token to access Slack. A Slack app that has the following permissions is required: | string | |||
Delay | The delay between polls. If no unit provided, milliseconds is the default. | string | 60000 | 60s or 6000 or 1m | |
Natural Order | Create exchanges in natural order (oldest to newest) or not. | boolean | false | ||
Server URL | The Slack API server endpoint URL. | string | https://slack.com |
Dependencies
At runtime, the slack-source
Kamelet relies upon the presence of the following dependencies:
-
camel:gson
-
camel:slack
-
camel:kamelet
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel
Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:slack-source"
parameters:
.
.
.
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command
camel run route.yaml
Slack Source Kamelet Description
Authentication
This Kamelet requires a Slack app token for authentication. You need to create a Slack app and obtain the necessary permissions to access channels and messages.
Configuration
The Slack Source Kamelet supports the following configurations:
-
Token: Slack app token for authentication (required)
-
Channel: Slack channel to monitor (required)
-
Server URL: Slack API server URL (optional, defaults to Slack’s API)
-
Delay: Polling interval in milliseconds for checking new messages
-
Max Results: Maximum number of messages to retrieve per poll
Output Format
The Kamelet outputs Slack messages as JSON objects containing message content, user information, timestamp, and channel details.
Setup Requirements
-
Create a Slack app in your workspace
-
Add necessary OAuth scopes (channels:history, channels:read)
-
Install the app to your workspace
-
Copy the OAuth access token
Usage Example
- route:
from:
uri: "kamelet:slack-source"
parameters:
token: "xoxb-your-slack-bot-token"
channel: "#general"
delay: 10000
steps:
- to:
uri: "kamelet:log-sink"
Example with Specific Channel ID
- route:
from:
uri: "kamelet:slack-source"
parameters:
token: "xoxb-your-slack-bot-token"
channel: "C1234567890"
delay: 5000
maxResults: 50
steps:
- to:
uri: "kamelet:log-sink"