Open Source .NET Framework that abstract out AWS CDK calls to EventBridge

0

Is there an Open Source .NET Framework that abstract out AWS CDK calls like sending message to EventBridge, logging etc...? The purpose is to focus on the business logic and not on infrastructure. MassTransit is such a framework but does not work with EventBridge.

  • Please note that AWS CDK (Cloud Development Kit) is not designed for integrating the AWS services into your applications, but it's rather an infrastructure-as-code toolkit. Did you mean AWS SDK (Software Development Kit) instead?

1개 답변
1
수락된 답변

Could you clarify what exactly you are looking to do? The existing open source AWS CDK library makes it very easy to create an EventBus in EventBridge that your application code can later use. For example, in one project I use the following to create one:

LicensingEventBus = new EventBus(this, "LicensingEvents", new EventBusProps
    {
        EventBusName = "LicensingEvents"
    }
);

In my application code, I then use the AWS SDK for .NET to push events on to the EventBus:

_ebClient = new AmazonEventBridgeClient();
var transactionEvents = new PutEventsRequest();
var busEntry = new PutEventsRequestEntry
    {
        Source = this.GetType().Namespace,
        EventBusName = _eventBusName,
        DetailType = "transaction",
        Time = DateTime.Now,
        Detail = myEventJson
    };
transactionEvents.Entries.Add(busEntry);
await _ebClient.PutEventsAsync(transactionEvents);
AWS
답변함 2년 전
  • It is a noise when you use such code in the middle of business logic. These calls can be abstracted out so it will work well with business logic. nServiceBus, MassTransit are examples for libraries.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠