public override async Task <SendMessageResponse> SendMessageAsync(SendMessageRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (BytesHelper.TooLarge(request))
     {
         await _s3Client.PubSubS3Query(request, _s3Settings);
     }
     return(await base.SendMessageAsync(request, cancellationToken));
 }
示例#2
0
        public override async Task <PublishResponse> PublishAsync(PublishRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (string.IsNullOrEmpty(request.Subject))
            {
                request.Subject = "#"; // To allow for automatic http forwarding
            }
            if (request.MessageAttributes.ContainsKey(Constants.DelaySeconds) && int.Parse(request.MessageAttributes[Constants.DelaySeconds].StringValue) > 0)
            {
                if (BytesHelper.TooLarge(request, 32000))
                {
                    await _s3Client.PubSubS3Query(request, _messageDeliverySettings, cancellationToken);
                }

                return(await _stepFunctions.PublishAsync(request, _messageDeliverySettings.StateMachine, cancellationToken));
            }

            if (BytesHelper.TooLarge(request))
            {
                await _s3Client.PubSubS3Query(request, _messageDeliverySettings, cancellationToken);
            }

            return(await base.PublishAsync(request, cancellationToken));
        }