Skip to main content Skip to complementary content

Sending Slack notifications of Kafka events

To post messages about the change in task status from Kafka into Slack, you need to configure an incoming Webhook URL at Slack.

For more information about configuring Webhook URL at Slack, see https://api.slack.com/incoming-webhooks.

Procedure

  1. Go to https://<slack_room_name>.slack.com/apps/build/custom-integration.
  2. Select Incoming WebHooks.
  3. From the Post to Channel field, select a channel where to post messages from Kafka events, or create a new channel.
  4. Click Add Incoming WebHooks integration to generate a Webhook URL.
  5. Add the generated URL to the Java class.
  6. Define the message body in the java class, for example:
    messageBody = "The state of task *" + dataEvent.getResourceId() + "* has been updated from *"
                                + fieldModification.getPreviousValue() + "* to *" + fieldModification.getNewValue() + "*.";
  7. Save your changes.

Results

Whenever a task changes status to Resolved in Talend Data Stewardship, a message will be posted to the specified channel in Slack as below:

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!