4장. Kamelets 참조


4.1. Kamelet 구조

Kamelet은 일반적으로 YAML 도메인별 언어로 코딩됩니다. 파일 이름 접두사는 Kamelet의 이름입니다. 예를 들어 FTP sink 라는 이름이 있는 Kamelet에는 파일 이름 ftp-sink.kamelet.yaml 이 있습니다.

OpenShift에서 Kamelet은 Kamelet의 이름을 표시하는 리소스입니다(파일 이름이 아님).

높은 수준에서 Kamelet 리소스는 다음을 설명합니다.

  • Kamelet의 ID 및 Kamelet 유형(소스,싱크 또는 작업)과 같은 기타 정보가 포함된 metadata 섹션입니다.
  • Kamelet을 구성하는 데 사용할 수 있는 매개변수 집합이 포함된 정의(JSON-schema 사양).
  • Kamelet에서 예상되는 입력 및 출력에 대한 정보가 포함된 선택적 types 섹션
  • Kamelet의 구현을 정의하는 YAML DSL의 Camel 템플릿.

다음 다이어그램에서는 Kamelet 및 해당 부분의 예를 보여줍니다.

예제 Kamelet 구조

telegram-text-source.kamelet.yaml
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
  name: telegram-source 
1

  annotations: 
2

    camel.apache.org/catalog.version: "master-SNAPSHOT"
    camel.apache.org/kamelet.icon: "data:image/..."
    camel.apache.org/provider: "Red Hat"
    camel.apache.org/kamelet.group: "Telegram"
  labels: 
3

    camel.apache.org/kamelet.type: "source"
spec:
  definition: 
4

    title: "Telegram Source"
    description: |-
        Receive all messages that people send to your telegram bot.
        To create a bot, contact the @botfather account using the
        Telegram app.
        The source attaches the following headers to the messages:
        - chat-id / ce-chatid: the ID of the chat where the
        message comes from
    required:
        - authorizationToken
    type: object
    properties:
        authorizationToken:
          title: Token
          description: The token to access your bot on Telegram, that you
                   can obtain from the Telegram "Bot Father".
          type: string
          format: password
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:password
  types: 
5

    out:
      mediaType: application/json
  dependencies:
  - "camel:jackson"
  - "camel:kamelet"
  - "camel:telegram"
  template: 
6

    from:
        uri: telegram:bots
        parameters:
            authorizationToken: "{{authorizationToken}}"
        steps:
        - set-header:
          name: chat-id
          simple: "${header[CamelTelegramChatId]}"
        - set-header:
          name: ce-chatid
          simple: "${header[CamelTelegramChatId]}"
        - marshal:
          json: {}
        - to: "kamelet:sink"
Copy to Clipboard Toggle word wrap
  1. Kamelet ID - Kamelet을 참조하려는 경우 Camel K 통합에서 이 ID를 사용합니다.
  2. icon과 같은 주석은 Kamelet에 대한 표시 기능을 제공합니다.
  3. 레이블을 사용하면 사용자가 Kamelets를 쿼리할 수 있습니다(예: kind: "source", "sink" 또는 "action")
  4. JSON-schema 사양 형식의 Kamelet 및 매개변수에 대한 설명입니다.
  5. 출력의 미디어 유형( 스키마를 포함할 수 있음).
  6. Kamelet의 동작을 정의하는 경로 템플릿입니다.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat