본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #3925

azure-eventgrid-java

하는 일

프로그램이 체계적인 방식으로 메시지를 보내고 받도록 돕는 도구입니다. 알림처럼 작동하며, 시스템의 여러 부분을 연결하거나 한 서비스가 다른 서비스에 무언가 일어났음을 알리는 데 유용합니다.

사용하는 경우

  • ✓한 서비스가 다른 서비스에 새 정보(예: 새 주문)를 알려야 할 때.
  • ✓서로 메시지를 주고받아야 하는 여러 애플리케이션을 연결할 때.
  • ✓한 서비스의 이벤트가 다른 서비스의 동작을 일으키도록 하고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-eventgrid-java/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-eventgrid-java/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“새 고객이 등록되었다는 알림을 보내도록 제 프로그램을 어떻게 만드나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

프로그램이 메시지 ‘토픽’에 연결되도록 설정합니다. 그다음 유형과 내용을 지정해 토픽에 메시지를 보낼 수 있습니다. 다른 프로그램은 이 토픽을 ‘듣고’ 메시지를 받을 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Azure Event Grid SDK for Java

Build event-driven applications using the Azure Event Grid SDK for Java.

Installation

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-messaging-eventgrid</artifactId>
    <version>4.27.0</version>
</dependency>

Client Creation

EventGridPublisherClient

import com.azure.messaging.eventgrid.EventGridPublisherClient;
import com.azure.messaging.eventgrid.EventGridPublisherClientBuilder;
import com.azure.core.credential.AzureKeyCredential;

// With API Key
EventGridPublisherClient<EventGridEvent> client = new EventGridPublisherClientBuilder()
    .endpoint("<topic-endpoint>")
    .credential(new AzureKeyCredential("<access-key>"))
    .buildEventGridEventPublisherClient();

// For CloudEvents
EventGridPublisherClient<CloudEvent> cloudClient = new EventGridPublisherClientBuilder()
    .endpoint("<topic-endpoint>")
    .credential(new AzureKeyCredential("<access-key>"))
    .buildCloudEventPublisherClient();

With DefaultAzureCredential

import com.azure.identity.DefaultAzureCredentialBuilder;

EventGridPublisherClient<EventGridEvent> client = new EventGridPublisherClientBuilder()
    .endpoint("<topic-endpoint>")
    .credential(new DefaultAzureCredentialBuilder().build())
    .buildEventGridEventPublisherClient();

Async Client

import com.azure.messaging.eventgrid.EventGridPublisherAsyncClient;

EventGridPublisherAsyncClient<EventGridEvent> asyncClient = new EventGridPublisherClientBuilder()
    .endpoint("<topic-endpoint>")
    .credential(new AzureKeyCredential("<access-key>"))
    .buildEventGridEventPublisherAsyncClient();

Event Types

Type Description
EventGridEvent Azure Event Grid native schema
CloudEvent CNCF CloudEvents 1.0 specification
BinaryData Custom schema events

Core Patterns

Publish EventGridEvent

import com.azure.messaging.eventgrid.EventGridEvent;
import com.azure.core.util.BinaryData;

EventGridEvent event = new EventGridEvent(
    "resource/path",           // subject
    "MyApp.Events.OrderCreated", // eventType
    BinaryData.fromObject(new OrderData("order-123", 99.99)), // data
    "1.0"                      // dataVersion
);

client.sendEvent(event);

Publish Multiple Events

List<EventGridEvent> events = Arrays.asList(
    new EventGridEvent("orders/1", "Order.Created", 
        BinaryData.fromObject(order1), "1.0"),
    new EventGridEvent("orders/2", "Order.Created", 
        BinaryData.fromObject(order2), "1.0")
);

client.sendEvents(events);

Publish CloudEvent

import com.azure.core.models.CloudEvent;
import com.azure.core.models.CloudEventDataFormat;

CloudEvent cloudEvent = new CloudEvent(
    "/myapp/orders",           // source
    "order.created",           // type
    BinaryData.fromObject(orderData), // data
    CloudEventDataFormat.JSON  // dataFormat
);
cloudEvent.setSubject("orders/12345");
cloudEvent.setId(UUID.randomUUID().toString());

cloudClient.sendEvent(cloudEvent);

Publish CloudEvents Batch

List<CloudEvent> cloudEvents = Arrays.asList(
    new CloudEvent("/app", "event.type1", BinaryData.fromString("data1"), CloudEventDataFormat.JSON),
    new CloudEvent("/app", "event.type2", BinaryData.fromString("data2"), CloudEventDataFormat.JSON)
);

cloudClient.sendEvents(cloudEvents);

Async Publishing

asyncClient.sendEvent(event)
    .subscribe(
        unused -> System.out.println("Event sent successfully"),
        error -> System.err.println("Error: " + error.getMessage())
    );

// With multiple events
asyncClient.sendEvents(events)
    .doOnSuccess(unused -> System.out.println("All events sent"))
    .doOnError(error -> System.err.println("Failed: " + error))
    .block(); // Block if needed

Custom Event Data Class

public class OrderData {
    private String orderId;
    private double amount;
    private String customerId;
    
    public OrderData(String orderId, double amount) {
        this.orderId = orderId;
        this.amount = amount;
    }
    
    // Getters and setters
}

// Usage
OrderData order = new OrderData("ORD-123", 150.00);
EventGridEvent event = new EventGridEvent(
    "orders/" + order.getOrderId(),
    "MyApp.Order.Created",
    BinaryData.fromObject(order),
    "1.0"
);

Receiving Events

Parse EventGridEvent


…
자주 묻는 질문

‘이벤트’란 무엇인가요?

무언가 일어났음을 알려 주는 메시지와 같습니다. 예를 들어 ‘주문 생성’, ‘사용자 로그인’, ‘파일 업로드’ 같은 것입니다.

‘토픽’이란 무엇인가요?

통신 채널과 같습니다. 프로그램은 토픽에 이벤트를 보내고, 다른 프로그램은 같은 토픽에서 이벤트를 받습니다.

어떤 종류의 정보든 보낼 수 있나요?

네, 표준 또는 사용자 지정 스키마를 사용해 주문 데이터나 사용자 정보 등 여러 형식의 정보를 보낼 수 있습니다.

상세 정보

작성자의 원본 설명

Build event-driven applications with Azure Event Grid SDK for Java. Use when publishing events, implementing pub/sub patterns, or integrating with Azure services via events.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#3925
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬