1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
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);
respondido hace 2 años
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.
Contenido relevante
- OFICIAL DE AWSActualizada hace 7 meses
- ¿Cómo puedo hacer una llamada al SDK de AWS desde un proyecto de CDK mediante la interfaz AWSdkCall?OFICIAL DE AWSActualizada hace 10 meses
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 10 meses
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?