Messaging and Notification

AWS Simple Notification System (SNS)

  • Description: the AWS SNS component allows messages to be sent to an Amazon Simple Notification Topic.

  • Example

    • The flow starts with a POST request at the endpoint /hello.

    • When a request is received, a message is sent to a topic in the AWS Simple Notification Service (SNS).

Script

Diagram

- from:
    uri: "rest:post:/hello"
    steps:
    - to:
        uri: "aws2-sns:topicNaneOrArn"
        parameters:
          accessKey: "{{accessKey}}"
          secretKey: "{{secretKey}}"
component aws sns

AWS Simple Queue Service (SQS)

  • Description: the AWS SQS component supports sending and receiving messages to the Amazon SQS service.

  • Example

    • The flow starts with a POST request at the endpoint /hello.

    • When a request is received, a message is sent to the Amazon SQS service.

Script

Diagram

- from:
    uri: "rest:post:/hello"
    steps:
    - to:
        uri: "aws2-sqs:queueNameOrArn"
        parameters:
          accessKey: "{{accessKey}}"
          secretKey: "{{secretKey}}"
component aws sqs

Google Pub/Sub

  • Description: The Google Pub/Sub component enables integration with the Google Cloud Pub/Sub service to publish and consume messages. It is ideal for asynchronous communication between applications, facilitating data exchange in distributed scenarios.

  • Example

    • The integration is triggered by a POST request to /my-api.

    • The message body is transformed to uppercase (${body.toUpperCase()}) and prefixed with "Transformed message: ".

    • The transformed message is sent to the specified Google Pub/Sub topic.

    • The parameters include:

      • serviceAccountKey: JSON file of the service account used for authentication.

      • destinationName: name of the topic on Google Pub/Sub.

    • A log is recorded informing that the message was sent to the Pub/Sub topic.

Script

Diagram

- from:
    id: rest-trigger-123456
    uri: "rest:post:/my-api"
    steps:
      - setBody:
          id: setBody-2320563641
          simple: 'Transformed message: ${body.toUpperCase()}'
      - to:
          uri: google-pubsub:my-project:my-topic
          parameters:
            serviceAccountKey: service-account.json
            destinationName: my-topic
      - log:
          id: log-2088714838
          message: 'Message sent to Pub/Sub topic: ${body}'
component google pub sub connector

Kafka

  • Description: the Kafka component is used for communication with the Apache Kafka message broker.

  • Example

    • The flow starts with a POST request at the endpoint /kafka.

    • The received message is then sent to one or more Kafka topics that match the pattern retry*.

    • The connection to Kafka is made through the specified broker.

    • URI parameters:

      • brokers: "54.207.234.81:38082": specifies the address of the Kafka broker (in this case, 54.207.234.81 on port 38082).

      • topicIsPattern: true: indicates that the topic to which the message is being sent should be interpreted as a pattern, allowing messages to be sent to all topics that match the pattern retry*.

Script

Diagram

- from:
    uri: "rest:post:/kafka"
    steps:
    - to:
        uri: "kafka:retry*"
        parameters:
          brokers: "54.207.234.81:38082"
          topicIsPattern: true
component kafka

Paho

  • Description: The Paho component enables applications to integrate with the MQTT protocol, facilitating communication between devices and systems in Internet of Things (IoT) environments.

  • Example

    • The flow starts with a GET request to the sensor/temperature endpoint.

    • The sensor message is received via the Paho connector (configured with the MQTT broker URL: ssl://broker.brokername.com:8883) and sent to the next step.

    • The flow logs the message received from the MQTT sensor using the variable ${body} to display the message content.

    • If a message with the content "Sensor data: 24°C" is published to the sensor/temperature topic, the log will record: "Got message Sensor data: 24°C".

Script

Diagram

- from:
    uri: "rest:get:/sensor/temperature"
    steps:
      - to:
          uri: "paho:sensor/temperature"
          parameters:
            brokerUrl: "ssl://broker.brokername.com:8883"
      - log:
          message: "Got message ${body}"
component paho connector

Paho MQTT5

  • Description: The Paho MQTT5 component enables applications to integrate with the MQTT protocol (version 5), offering advanced messaging features such as persistent sessions and flow control.

  • Example

    • The flow is identical to the one described for the Paho component, with the difference that this uses version 5 of the MQTT protocol.

Script

Diagram

- from:
    uri: "rest:get:/sensor/temperature"
    steps:
      - to:
          uri: "paho-mqtt5:sensor/temperature"
          parameters:
            brokerUrl: "ssl://broker.brokername.com:8883"
      - log:
          message: "Got message ${body}"
component paho mqtt5 connector

Slack

  • Description: The Slack component allows you to send messages, notifications, and alerts to Slack channels or users directly from your integration flows.

  • Example

    • The flow makes a POST request to the /hello endpoint.

    • It sends the response to a Slack channel using an authentication token.

    • Then, it logs a confirmation message indicating that the message was successfully sent.

Script

Diagram

- from:
    uri: "rest:post:/hello"
    steps:
      - to:
          uri: "slack:#channel"
          parameters:
            token: "your-slack-token"
      - log:
          message: "Message successfully sent to Slack: ${body}"
component slack connector
Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]