Triggers

Check the description of each trigger approved for use in Sensedia Integrations:

Azure Storage Blob Service

  • Description: The Azure Storage Blob Service component is used to store and retrieve blobs (binary large objects) from the Azure Storage Blob service using Azure v12 APIs.

  • Example

    • This flow monitors a container in Azure Storage Blob to list blobs (operation:listBlobs) available.

    • When a new blob is detected, the flow connects to an FTPS server to download files with the .txt extension.

    • Parameters:

      • username and password: authentication credentials.

      • includeExt: specifies that only .txt files should be downloaded.

      • delay: the connector checks for new files every 10 seconds.

      • passiveMode: enables passive mode for the connection.

      • After downloading, the file contents are logged.

Script

Diagram

- from:
    uri: "azure-storage-blob://camelstorageaccount01/myblobcontainer"
    parameters:
          credentialType: "SHARED_ACCOUNT_KEY"
          operation: "listBlobs"
          accessKey: "{{AWS_ACCESS_KEY}}"
    steps:
      - to:
          uri: "ftps:demo.wftpserver.com/download"
          parameters:
            username: "demo"
            password: "demo"
            includeExt: "txt"
            delay: 10000
            passiveMode: true
      - log:
          loggingLevel: INFO
          message: "Downloaded File Content\n: ${body}"
component azure storage blob service trigger

AWS S3 Storage Service

  • Description: the AWS S3 Storage Service component allows you to interact with the Amazon S3 service (Simple Storage Service) from AWS and manipulate data in S3 buckets directly through the integration routes.

  • Example

    • The flow is triggered by new events in an AWS S3 bucket (aws2-s3://bucket-s3).

    • The parameters specify the credentials used (stored in variables) and the bucket’s location.

    • Then, it logs a message with the content of the file or object processed from the bucket.

Script

Diagram

- from:
    uri: "aws2-s3://bucket-s3"
    parameters:
      region: us-east-1
      accessKey: "{{ACCESS_KEY}}"
      secretKey: "{{SECRET_KEY}}"
    steps:
      - log:
          message: "Body: ${body}"
component aws3

AWS Simple Queue Service (SQS)

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

  • Example

    • The flow retrieves messages from an AWS SQS queue. Access credentials (accessKey and secretKey) allow the flow to authenticate with AWS.

    • The received messages are logged at the info level, enabling you to view the processed data.

Script

Diagram

- from:
    uri: "aws2-sqs:queueNameOrArn"
    parameters:
      accessKey: "{{accessKey}}"
      secretKey: "{{secretKey}}"
    steps:
      - to:
          uri: "log:info"
component aws sqs trigger

Cron

  • Description: the Cron component allows events to be triggered at specific time intervals.

  • Example

    • The snippet below configures a route to be executed every 5 minutes, and then logs a message.

Script

Diagram

- from:
    uri: "cron:my-cron"
    parameters:
      schedule: "0/5 * * * *"
    steps:
    - log:
        message: "Executed every 5 minutes"
component cron

FTP/FTPS

  • Description: the FTP component provides access to remote file systems through FTP and SFTP protocols. It operates only in passive mode.

FTPS is a secure version of FTP that adds support for SSL/TLS to encrypt the connection.
  • Example

    • The flow connects to an FTP server and downloads text files.

    • The parameters indicate the credentials used for authentication (username and password) and that it should filter and include only files with the .txt extension.

    • The flow includes a delay of 10 seconds between download attempts and operates in passive mode.

    • Then, it logs the content of these files in a log.

Script

Diagram

- from:
    uri: "ftp://demo.wftpserver.com/download"
    parameters:
      username: "demo"
      password: "demo"
      includeExt: "txt"
      delay: 10000
      passiveMode: true
    steps:
    - log:
        message: "Downloaded File Content\n: ${body}"
component ftp

Kafka

  • Description: the Kafka component is used to communicate with the Apache Kafka message broker.

  • Example

    • The flow starts by receiving messages from the Kafka topic my-topic, configured with the brokers settings.

    • Then, the received message is logged for monitoring and debugging.

Script

Diagram

- from:
    uri: "kafka:my-topic"
    parameters:
      brokers: "localhost:9092"
    steps:
      - log:
          message: "Mensagem recebida do Kafka: ${body}"
component kafka trigger

Mail

IMAP/IMAPS

  • Description: IMAP is a protocol used for receiving emails, allowing access to various mail folders and the manipulation of messages directly on the server.

    IMAPS is a secure version of IMAP that transmits data encrypted using SSL/TLS.
  • Example

    • The flow is configured to connect to an email account using the IMAP protocol on the Gmail server (imap.gmail.com) on port 993.

    • URI parameters:

      • The flow uses the provided credentials (username and password) for authentication;

      • It is configured not to delete emails (delete=false);

      • It is set to fetch only unread messages (unseen=true);

      • There is a delay of 60 seconds (delay=60000), meaning it will check for new emails every minute.

    • When a new email is found, the full content of the email is logged.

Script

Diagram

- from:
    uri: "imaps://imap.gmail.com:993"
    parameters:
      username: "yourusername"
      password: "yourpassword"
      delete: false
      unseen: true
      delay: 60000
    steps:
    - to:
        uri: "log:email"
        parameters:
          showAll: true
component imaps

POP3/POP3S

  • Description: the POP3 component is used to retrieve emails from POP3 servers, allowing Camel to access the inbox, read the messages, and process them automatically in an integration flow.

POP3S is a secure version of POP3 that transmits data encrypted using SSL/TLS.
  • Example

    • The code shows a connection to an email server using the secure POP3 protocol (POP3S) to access a Gmail account.

    • URI parameters:

      • username=yourusername: username;

      • password=yourpassword: password;

      • delete=false: specifies that messages should not be deleted from the server after being read;

      • unseen=true: indicates that only messages that have not yet been read should be retrieved;

      • delay=60000: sets a 60-second delay between each attempt to retrieve new messages.

Script

Diagram

- from:
    uri: "pop3s://pop.gmail.com:995"
    parameters:
      username: "yourusername"
      password: "yourpassword"
      delete: false
      unseen: true
      delay: 60000
    steps:
    - to:
        uri: "log:email"
        parameters:
          showAll: true
component pop3s

SMTP/SMTPS

  • Description: the [SMTP] component is used to send emails to SMTP servers, allowing Camel to send messages with custom content, attachments, and recipients in an integration flow.

SMTPS is a secure version of SMTP that encrypts data transmission using SSL/TLS.
  • Example

    • The flow uses the provided credentials to authenticate with Gmail’s email server, enabling the sending of messages.

    • URI Parameters:

      • username: "yourusername": the Gmail account username used for authentication.

      • password: "yourpassword": the Gmail account password.

      • mail.smtp.auth: "auth": indicates that SMTP authentication should be used.

      • mail.smtp.starttls.enable: "starttls": enables STARTTLS, a mechanism to upgrade an insecure connection to a secure one using TLS.

    • After sending, all email details are logged to facilitate monitoring and debugging.

Script

Diagram

- from:
    uri: "smtps://smtp.gmail.com:465"
    parameters:
        username: "yourusername"
        password: "yourpassword"
        mail.smtp.auth: "true"
        mail.smtp.starttls.enable: "true"
    steps:
      - to:
          uri: "log:receivedEmail"
          parameters:
            showAll: true
component smtp trigger

Paho

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

  • Example

    • The flow begins by subscribing to the sensor/temperature topic on an MQTT broker, using a secure SSL connection at the URL broker.brokername.com:8883.

    • It logs a message with the received content: Got message ${body}.

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

Script

Diagram

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

Paho MQTT5

  • Description: the Paho MQTT5 component enables the integration of applications 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, except it uses version 5 of the MQTT protocol.

Script

Diagram

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

Quartz

  • Description: the Quartz component allows scheduling and triggering events based on cron expressions. It enables configuring tasks to be triggered at regular intervals, such as every minute, hour, or day, using standard cron syntax.

  • Example

    • The flow is triggered by the Quartz component every hour, precisely at the 59th minute.

    • Then a test message is logged.

Script

Diagram

- from:
    uri: "quartz://test"
    parameters:
      cron: "59 * * * *"
    steps:
    - log:
        message: "This is a test"
component quartz

REST

  • Description: the REST component allows creating and managing RESTful endpoints, facilitating communication between applications via the HTTP protocol. It enables the definition of routes that respond to HTTP requests (such as GET, POST, PUT, and DELETE), processing data, invoking services, and manipulating information.

  • Example

    • The flow starts with a POST request to /demo.

    • There are no additional parameters, indicating that the default endpoint settings will be used.

    • Then a test message is logged.

Script

Diagram

- from:
    uri: rest:post:/demo
    parameters: {}
    steps:
    - log:
        message: "This is a test"
component rest

Scheduler

  • Description: the Scheduler component is used to generate message exchanges when a scheduler triggers.

  • Example

    • In the snippet below, the URI shows a scheduler named mySchedulerName, which is triggered every 60 seconds.

    • Then a test message is logged.

Script

Diagram

- from:
    uri: "scheduler:mySchedulerName"
    parameters:
      timeUnit: SECONDS
      delay: 60
    steps:
    - log:
        message: "This is a test"
component scheduler

SFTP

  • Description: the SFTP component provides access to remote file systems using FTP and SFTP protocols. It operates in passive mode only.

  • Example

    • The flow reads .txt files from a specified SFTP server, using a username and password for authentication.

    • After the download, the content of the files is sent to a log for record-keeping.

Script

Diagram

- from:
    uri: "sftp:demo.wftpserver.com:2222/download"
    parameters:
      username: "demo"
      password: "demo"
      includeExt: "txt"
      delay: 10000
    steps:
      - to:
          uri: "log:responseLogger"
component sftp trigger

Slack

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

  • Example

    • The flow listens for messages in the specified Slack channel.

    • The Slack authentication token is included in the parameters.

    • When a message is received, it is captured and logged with its content.

Script

Diagram

- from:
    uri: "slack:#channel"
    parameters:
      token: "your-slack-token"
    steps:
      - log:
          message: "Received message from Slack: ${body}"
component slack

Timer

  • Description: the Timer component is used to generate message exchanges when a timer triggers.

  • Example

    • In the snippet below, the URI shows a timer named mytimer, which is triggered every 30 seconds (30,000 milliseconds).

    • Then a test message is logged.

Script

Diagram

- from:
    uri: "timer:mytimer"
    parameters:
      period: 30000
    steps:
      - log:
          message: "This is a test."
component timer
Thanks for your feedback!
EDIT

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