public MessageReceiver(MessageReceiverConfig config, IQueueClient queueClient, IReceiveMessageRequestBuilder requestBuilder) { _queueClient = queueClient; _requestConfig = requestBuilder.Build(config); _receivedCache = new Queue <ReceivedMessage>(); }
public static IMessageReceiver GetReceiver(IQueueClient amazonQueueClient, MessageReceiverConfig messageReceiverConfig) { IMessageReceiver receiver = new MessageReceiver(messageReceiverConfig, amazonQueueClient); return(receiver); }
public static IMessageReceiver GetReceiver(AmazonSQSClient amazonSqsClient, MessageReceiverConfig messageReceiverConfig, CancellationToken cancellationToken) { IMessageReceiver receiver = new MessageReceiver(messageReceiverConfig, new SqsQueueClient(amazonSqsClient, cancellationToken)); return(receiver); }
public static IMessageReceiver GetReceiver(AWSCredentials awsCredentials, string awsRegion, MessageReceiverConfig messageReceiverConfig, CancellationToken cancellationToken) { var sqsClient = new AmazonSQSClient(awsCredentials, RegionEndpoint.GetBySystemName(awsRegion)); IMessageReceiver receiver = new MessageReceiver(messageReceiverConfig, new SqsQueueClient(sqsClient, cancellationToken)); return(receiver); }
public static IMessageReceiver GetReceiver(string awsAccessKey, string awsSecretKey, string awsRegion, MessageReceiverConfig messageReceiverConfig, CancellationToken cancellationToken) { AWSCredentials creds = new BasicAWSCredentials(awsAccessKey, awsSecretKey); var sqsClient = new AmazonSQSClient(creds, RegionEndpoint.GetBySystemName(awsRegion)); IMessageReceiver receiver = new MessageReceiver(messageReceiverConfig, new SqsQueueClient(sqsClient, cancellationToken)); return(receiver); }
public MessageReceiver(MessageReceiverConfig config, IQueueClient queueClient) : this(config, queueClient, new ReceiveMessageRequestBuilder()) { }