internal ReceiveMessageResponse ReceiveMessage(ReceiveMessageRequest request) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return(Invoke <ReceiveMessageRequest, ReceiveMessageResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the ReceiveMessage operation. /// <seealso cref="Amazon.SQS.IAmazonSQS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <ReceiveMessageResponse> ReceiveMessageAsync(ReceiveMessageRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return(Invoke <IRequest, ReceiveMessageRequest, ReceiveMessageResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
public async Task <ReceiveMessageResponse> ReceiveMessageAsync(ReceiveMessageRequest request) { request.QueueName = this.QueueName; var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return(await _serviceClient.InvokeAsync <ReceiveMessageRequest, ReceiveMessageResponse>(request, marshaller, unmarshaller).ConfigureAwait(false)); }
/// <inheritdoc/> public ReceiveMessageResponse ReceiveMessage(ReceiveMessageRequest request) { request.QueueName = this.QueueName; var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return(_serviceClient.Invoke <ReceiveMessageRequest, ReceiveMessageResponse>(request, marshaller, unmarshaller)); }
/// <inheritdoc/> public IAsyncResult BeginReceiveMessage(ReceiveMessageRequest request, AsyncCallback callback, object state) { request.QueueName = this.QueueName; var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return(_serviceClient.BeginInvoke <ReceiveMessageRequest>(request, marshaller, unmarshaller, callback, state)); }
public void ReceiveMessageMarshallTest() { var operation = service_model.FindOperation("ReceiveMessage"); var request = InstantiateClassGenerator.Execute<ReceiveMessageRequest>(); var marshaller = new ReceiveMessageRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null); var response = ReceiveMessageResponseUnmarshaller.Instance.Unmarshall(context) as ReceiveMessageResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// <para>Retrieves one or more messages from the specified queue, including the message body and message ID of each message. Messages returned /// by this action stay in the queue until you delete them. However, once a message is returned to a <c>ReceiveMessage</c> request, it is not /// returned on subsequent <c>ReceiveMessage</c> requests for the duration of the <c>VisibilityTimeout</c> . If you do not specify a /// <c>VisibilityTimeout</c> in the request, the overall visibility timeout for the queue is used for the returned messages.</para> <para>If a /// message is available in the queue, the call will return immediately. Otherwise, it will wait up to <c>WaitTimeSeconds</c> for a message to /// arrive. If you do not specify <c>WaitTimeSeconds</c> in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine /// how long to wait.</para> <para>You could ask for additional information about each message through the attributes. Attributes that can be /// requested are <c>[SenderId, ApproximateFirstReceiveTimestamp, ApproximateReceiveCount, SentTimestamp]</c> .</para> /// </summary> /// /// <param name="receiveMessageRequest">Container for the necessary parameters to execute the ReceiveMessage service method on /// AmazonSQS.</param> /// /// <returns>The response from the ReceiveMessage service method, as returned by AmazonSQS.</returns> /// /// <exception cref="T:Amazon.SQS.Model.OverLimitException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ReceiveMessageResponse> ReceiveMessageAsync(ReceiveMessageRequest receiveMessageRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ReceiveMessageRequest, ReceiveMessageResponse>(receiveMessageRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the ReceiveMessage operation. /// <seealso cref="Amazon.SQS.IAmazonSQS.ReceiveMessage"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<ReceiveMessageResponse> ReceiveMessageAsync(ReceiveMessageRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ReceiveMessageRequest, ReceiveMessageResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Initiates the asynchronous execution of the ReceiveMessage operation. /// <seealso cref="Amazon.SQS.IAmazonSQS"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage operation on AmazonSQSClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndReceiveMessage /// operation.</returns> public IAsyncResult BeginReceiveMessage(ReceiveMessageRequest request, AsyncCallback callback, object state) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return BeginInvoke<ReceiveMessageRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Retrieves one or more messages, with a maximum limit of 10 messages, from the /// specified queue. Long poll support is enabled by using the <code>WaitTimeSeconds</code> /// parameter. For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html">Amazon /// SQS Long Poll</a> in the <i>Amazon SQS Developer Guide</i>. /// /// /// <para> /// Short poll is the default behavior where a weighted random set of machines is /// sampled on a <code>ReceiveMessage</code> call. This means only the messages /// on the sampled machines are returned. If the number of messages in the queue is small /// (less than 1000), it is likely you will get fewer messages than you requested /// per <code>ReceiveMessage</code> call. If the number of messages in the queue /// is extremely small, you might not receive any messages in a particular <code>ReceiveMessage</code> /// response; in which case you should repeat the request. /// </para> /// /// <para> /// For each message returned, the response includes the following: /// </para> /// <ul> <li> /// <para> /// Message body /// </para> /// </li> <li> /// <para> /// MD5 digest of the message body. For information about MD5, go to /// <a href="http://www.faqs.org/rfcs/rfc1321.html">http://www.faqs.org/rfcs/rfc1321.html</a>. /// /// </para> /// </li> <li> /// <para> /// Message ID you received when you sent the message to the queue. /// </para> /// </li> <li> /// <para> /// Receipt handle. /// </para> /// </li> <li> /// <para> /// Message attributes. /// </para> /// </li> <li> /// <para> /// MD5 digest of the message attributes. /// </para> /// </li> </ul> /// <para> /// The receipt handle is the identifier you must provide when deleting the message. /// For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html">Queue /// and Message Identifiers</a> in the <i>Amazon SQS Developer Guide</i>. /// </para> /// /// <para> /// You can provide the <code>VisibilityTimeout</code> parameter in your request, /// which will be applied to the messages that Amazon SQS returns in the response. /// If you do not include the parameter, the overall visibility timeout for the queue /// is used for the returned messages. For more information, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html">Visibility /// Timeout</a> in the <i>Amazon SQS Developer Guide</i>. /// </para> /// <note> /// <para> /// Going forward, new attributes might be added. If you are writing code that /// calls this action, we recommend that you structure your code so that it can /// handle new attributes gracefully. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage service method.</param> /// /// <returns>The response from the ReceiveMessage service method, as returned by SQS.</returns> /// <exception cref="OverLimitException"> /// The action that you requested would violate a limit. For example, ReceiveMessage /// returns this error if the maximum number of messages inflight has already been /// reached. <a>AddPermission</a> returns this error if the maximum number of permissions /// for the queue has already been reached. /// </exception> public ReceiveMessageResponse ReceiveMessage(ReceiveMessageRequest request) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return Invoke<ReceiveMessageRequest,ReceiveMessageResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ReceiveMessage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<ReceiveMessageResponse> ReceiveMessageAsync(ReceiveMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return InvokeAsync<ReceiveMessageRequest,ReceiveMessageResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeReceiveMessage(ReceiveMessageRequest receiveMessageRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ReceiveMessageRequestMarshaller().Marshall(receiveMessageRequest); var unmarshaller = ReceiveMessageResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ReceiveMessage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ReceiveMessage operation on AmazonSQSClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void ReceiveMessageAsync(ReceiveMessageRequest request, AmazonServiceCallback<ReceiveMessageRequest, ReceiveMessageResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<ReceiveMessageRequest,ReceiveMessageResponse> responseObject = new AmazonServiceResult<ReceiveMessageRequest,ReceiveMessageResponse>((ReceiveMessageRequest)req, (ReceiveMessageResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<ReceiveMessageRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
IAsyncResult invokeReceiveMessage(ReceiveMessageRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ReceiveMessageRequestMarshaller(); var unmarshaller = ReceiveMessageResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }