public async Task <SendMessageResponse> Enqueue(IntegrationEvent @event) { var contractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() }; var jsonMessage = JsonConvert.SerializeObject(@event, new JsonSerializerSettings { ContractResolver = contractResolver, Formatting = Formatting.Indented }); var createRequest = new SendMessageRequest { MessageDeduplicationId = IsTypeFifo ? Guid.NewGuid().ToString() : null, MessageBody = jsonMessage, QueueUrl = @event.ReplaceIntegrationEventName().BuildQueueUrl(IsTypeFifo), MessageGroupId = IsTypeFifo ? @event.Id : null }; @event.MessageAttributes.BuildToMessageAttribute(createRequest.MessageAttributes); return(await amazonSQS.SendMessageAsync(createRequest)); }
public async Task <DeleteMessageResponse> Dequeue(IntegrationEvent @event) { var deleteRequest = new DeleteMessageRequest { QueueUrl = @event.ReplaceIntegrationEventName().BuildQueueUrl(IsTypeFifo), ReceiptHandle = @event.ReceiptId }; return(await amazonSQS.DeleteMessageAsync(deleteRequest)); }