Class used to store all of the properties and credentials needed to interface with your Amazon Web Services Account.
 /// <summary>
 /// Used to create a new instance of the MessageGears client.
 /// </summary>
 /// <param name="props">
 /// Contains the credentials needed to access MessageGears, Amazon S3, and Amazon SQS.<see cref="MessageGearsProperties"/>
 /// </param>
 public MessageGearsAwsClient(MessageGearsAwsProperties props)
 {
     this.properties = props;
     this.sqs = new AmazonSQSClient(properties.MyAWSAccountKey, properties.MyAWSSecretKey);
     this.s3 = new AmazonS3Client(properties.MyAWSAccountKey, properties.MyAWSSecretKey);
     log.Info("MessageGears AWS client initialized");
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Used to create a new instance of the MessageGears client.
 /// </summary>
 /// <param name="props">
 /// Contains the credentials needed to access MessageGears, Amazon S3, and Amazon SQS.<see cref="MessageGearsProperties"/>
 /// </param>
 public MessageGearsAwsClient(MessageGearsAwsProperties props)
 {
     this.properties = props;
     this.sqs        = new AmazonSQSClient(properties.MyAWSAccountKey, properties.MyAWSSecretKey);
     this.s3         = new AmazonS3Client(properties.MyAWSAccountKey, properties.MyAWSSecretKey);
     log.Info("MessageGears AWS client initialized");
 }
 /// <summary>
 /// Instantiates the Poller.
 /// </summary>
 /// <param name="props">
 /// A <see cref="MessageGearsProperties"/>
 /// </param>
 /// <param name="listener">
 /// A <see cref="MessageGearsListener"/>
 /// </param>
 /// <param name="myAwsAccountKey">
 /// You AWS Account Key
 /// </param>
 /// <param name="myAwsSecretKey">
 /// Your AWS Secret Key
 /// </param>
 public MessageGearsAwsQueuePoller(MessageGearsAwsProperties props, MessageGearsListener listener)
 {
     this.props = props;
     this.emptyQueueDelayMillis = props.EmptyQueuePollingDelaySecs * 1000;
     this.listener = listener;
     AmazonSQSConfig config = new AmazonSQSConfig().WithMaxErrorRetry(props.SQSMaxErrorRetry);
     this.sqs = AWSClientFactory.CreateAmazonSQSClient (props.MyAWSAccountKey, props.MyAWSSecretKey, config);
     this.receiveMessageRequest = new ReceiveMessageRequest ()
         .WithQueueUrl (props.MyAWSEventQueueUrl)
         .WithMaxNumberOfMessages (props.SQSMaxBatchSize)
         .WithAttributeName("ApproximateReceiveCount")
         .WithVisibilityTimeout(props.SQSVisibilityTimeoutSecs);
     this.deleteMessageRequest = new DeleteMessageRequest().WithQueueUrl(props.MyAWSEventQueueUrl);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Instantiates the Poller.
        /// </summary>
        /// <param name="props">
        /// A <see cref="MessageGearsProperties"/>
        /// </param>
        /// <param name="listener">
        /// A <see cref="MessageGearsListener"/>
        /// </param>
        /// <param name="myAwsAccountKey">
        /// You AWS Account Key
        /// </param>
        /// <param name="myAwsSecretKey">
        /// Your AWS Secret Key
        /// </param>
        public MessageGearsAwsQueuePoller(MessageGearsAwsProperties props, MessageGearsListener listener)
        {
            this.props = props;
            this.emptyQueueDelayMillis = props.EmptyQueuePollingDelaySecs * 1000;
            this.listener = listener;
            AmazonSQSConfig config = new AmazonSQSConfig().WithMaxErrorRetry(props.SQSMaxErrorRetry);

            this.sqs = AWSClientFactory.CreateAmazonSQSClient(props.MyAWSAccountKey, props.MyAWSSecretKey, config);
            this.receiveMessageRequest = new ReceiveMessageRequest()
                                         .WithQueueUrl(props.MyAWSEventQueueUrl)
                                         .WithMaxNumberOfMessages(props.SQSMaxBatchSize)
                                         .WithAttributeName("ApproximateReceiveCount")
                                         .WithVisibilityTimeout(props.SQSVisibilityTimeoutSecs);
            this.deleteMessageRequest = new DeleteMessageRequest().WithQueueUrl(props.MyAWSEventQueueUrl);
        }