AWS SQS - inserting a single message but can only fetch a list?2019 Community Moderator ElectionSend message using MSMQ between two EC2 instancesWhy not inherit from List<T>?Amazon SQS Dead Letter Queue: Is it really dead letter or poison?NetMQ - messages only work on reply to incoming message, not to other porthandling multiple identical messages in aws sqsHow to accommodate Amazon FIFO SQS in Laravel queue?Feeding SQS Queues available in two different AWS AccountsWhat's the best architecture to use in this case? SQS? SNS? Combination of both?PDF, HTML and SVG conversions are not working in Aspose.CellsIAM Policy variables not recognised - $cognito-identity.amazonaws.com:sub

Is it possible to avoid unpacking when merging Association?

Word for a person who has no opinion about whether god exists

PTIJ: Should I kill my computer after installing software?

Reversed Sudoku

Definition of Statistic

Single word request: Harming the benefactor

What's wrong with this bogus proof?

What wound would be of little consequence to a biped but terrible for a quadruped?

Error during using callback start_page_number in lualatex

How to write ı (i without dot) character in pgf-pie

What was the Kree's motivation in Captain Marvel?

Was Luke Skywalker the leader of the Rebel forces on Hoth?

How to draw cubes in a 3 dimensional plane

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

What does "the touch of the purple" mean?

Is it "Vierergruppe" or "Viergruppe", or is there a distinction?

An alternative proof of an application of Hahn-Banach

Bash script should only kill those instances of another script's that it has launched

How do I express some one as a black person?

Recommendation letter by significant other if you worked with them professionally?

Do I really need to have a scientific explanation for my premise?

NASA's RS-25 Engines shut down time

Does this video of collapsing warehouse shelves show a real incident?

Shifting between bemols (flats) and diesis (sharps)in the key signature



AWS SQS - inserting a single message but can only fetch a list?



2019 Community Moderator ElectionSend message using MSMQ between two EC2 instancesWhy not inherit from List<T>?Amazon SQS Dead Letter Queue: Is it really dead letter or poison?NetMQ - messages only work on reply to incoming message, not to other porthandling multiple identical messages in aws sqsHow to accommodate Amazon FIFO SQS in Laravel queue?Feeding SQS Queues available in two different AWS AccountsWhat's the best architecture to use in this case? SQS? SNS? Combination of both?PDF, HTML and SVG conversions are not working in Aspose.CellsIAM Policy variables not recognised - $cognito-identity.amazonaws.com:sub










2















I'm using .Net core to access an SQS queue and get a message from that queue.



Everything works fine.



For inserting a message :



 var sendMessageRequest = new SendMessageRequest();
sendMessageRequest.QueueUrl = queueName;
sendMessageRequest.MessageBody = message;
sqs.SendMessage(sendMessageRequest);


Notice that I can only insert a single message :



enter image description here



However when I was looking at the ReceieveMessage method :



 public static void GetMessage(AmazonSQSClient sqs , string queueName )
{
var receiveMessageRequest = new ReceiveMessageRequest QueueUrl = queueName ;
var receiveMessageResponse = sqs.ReceiveMessage(receiveMessageRequest);


I've noticed that I can only get a list :



enter image description here



Question:



I don't understand how come I can insert a single message , but read a list of messages ?



Even if I have many messages in my queue , this code ^ only fetches one message :



enter image description here



Where I have 6 messages :



enter image description here










share|improve this question


























    2















    I'm using .Net core to access an SQS queue and get a message from that queue.



    Everything works fine.



    For inserting a message :



     var sendMessageRequest = new SendMessageRequest();
    sendMessageRequest.QueueUrl = queueName;
    sendMessageRequest.MessageBody = message;
    sqs.SendMessage(sendMessageRequest);


    Notice that I can only insert a single message :



    enter image description here



    However when I was looking at the ReceieveMessage method :



     public static void GetMessage(AmazonSQSClient sqs , string queueName )
    {
    var receiveMessageRequest = new ReceiveMessageRequest QueueUrl = queueName ;
    var receiveMessageResponse = sqs.ReceiveMessage(receiveMessageRequest);


    I've noticed that I can only get a list :



    enter image description here



    Question:



    I don't understand how come I can insert a single message , but read a list of messages ?



    Even if I have many messages in my queue , this code ^ only fetches one message :



    enter image description here



    Where I have 6 messages :



    enter image description here










    share|improve this question
























      2












      2








      2


      1






      I'm using .Net core to access an SQS queue and get a message from that queue.



      Everything works fine.



      For inserting a message :



       var sendMessageRequest = new SendMessageRequest();
      sendMessageRequest.QueueUrl = queueName;
      sendMessageRequest.MessageBody = message;
      sqs.SendMessage(sendMessageRequest);


      Notice that I can only insert a single message :



      enter image description here



      However when I was looking at the ReceieveMessage method :



       public static void GetMessage(AmazonSQSClient sqs , string queueName )
      {
      var receiveMessageRequest = new ReceiveMessageRequest QueueUrl = queueName ;
      var receiveMessageResponse = sqs.ReceiveMessage(receiveMessageRequest);


      I've noticed that I can only get a list :



      enter image description here



      Question:



      I don't understand how come I can insert a single message , but read a list of messages ?



      Even if I have many messages in my queue , this code ^ only fetches one message :



      enter image description here



      Where I have 6 messages :



      enter image description here










      share|improve this question














      I'm using .Net core to access an SQS queue and get a message from that queue.



      Everything works fine.



      For inserting a message :



       var sendMessageRequest = new SendMessageRequest();
      sendMessageRequest.QueueUrl = queueName;
      sendMessageRequest.MessageBody = message;
      sqs.SendMessage(sendMessageRequest);


      Notice that I can only insert a single message :



      enter image description here



      However when I was looking at the ReceieveMessage method :



       public static void GetMessage(AmazonSQSClient sqs , string queueName )
      {
      var receiveMessageRequest = new ReceiveMessageRequest QueueUrl = queueName ;
      var receiveMessageResponse = sqs.ReceiveMessage(receiveMessageRequest);


      I've noticed that I can only get a list :



      enter image description here



      Question:



      I don't understand how come I can insert a single message , but read a list of messages ?



      Even if I have many messages in my queue , this code ^ only fetches one message :



      enter image description here



      Where I have 6 messages :



      enter image description here







      c# amazon-web-services .net-core amazon-sqs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 6 at 15:22









      Royi NamirRoyi Namir

      76.1k99333596




      76.1k99333596






















          1 Answer
          1






          active

          oldest

          votes


















          4














          If you want to send multiple messages in a single API call, there is SendMessageBatch documented here and here.



          If you want to receive only a single message per request, you would set ReceiveMessageRequest.MaxNumberOfMessages to 1.






          share|improve this answer























          • Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

            – Royi Namir
            Mar 6 at 15:36












          • You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

            – Mark B
            Mar 6 at 15:45











          • Got it. it's AWS that determines how much to fetch up to this max boundry.

            – Royi Namir
            Mar 6 at 15:46






          • 1





            @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

            – Michael - sqlbot
            Mar 7 at 9:05










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026522%2faws-sqs-inserting-a-single-message-but-can-only-fetch-a-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          If you want to send multiple messages in a single API call, there is SendMessageBatch documented here and here.



          If you want to receive only a single message per request, you would set ReceiveMessageRequest.MaxNumberOfMessages to 1.






          share|improve this answer























          • Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

            – Royi Namir
            Mar 6 at 15:36












          • You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

            – Mark B
            Mar 6 at 15:45











          • Got it. it's AWS that determines how much to fetch up to this max boundry.

            – Royi Namir
            Mar 6 at 15:46






          • 1





            @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

            – Michael - sqlbot
            Mar 7 at 9:05















          4














          If you want to send multiple messages in a single API call, there is SendMessageBatch documented here and here.



          If you want to receive only a single message per request, you would set ReceiveMessageRequest.MaxNumberOfMessages to 1.






          share|improve this answer























          • Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

            – Royi Namir
            Mar 6 at 15:36












          • You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

            – Mark B
            Mar 6 at 15:45











          • Got it. it's AWS that determines how much to fetch up to this max boundry.

            – Royi Namir
            Mar 6 at 15:46






          • 1





            @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

            – Michael - sqlbot
            Mar 7 at 9:05













          4












          4








          4







          If you want to send multiple messages in a single API call, there is SendMessageBatch documented here and here.



          If you want to receive only a single message per request, you would set ReceiveMessageRequest.MaxNumberOfMessages to 1.






          share|improve this answer













          If you want to send multiple messages in a single API call, there is SendMessageBatch documented here and here.



          If you want to receive only a single message per request, you would set ReceiveMessageRequest.MaxNumberOfMessages to 1.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 6 at 15:34









          Mark BMark B

          103k16163177




          103k16163177












          • Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

            – Royi Namir
            Mar 6 at 15:36












          • You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

            – Mark B
            Mar 6 at 15:45











          • Got it. it's AWS that determines how much to fetch up to this max boundry.

            – Royi Namir
            Mar 6 at 15:46






          • 1





            @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

            – Michael - sqlbot
            Mar 7 at 9:05

















          • Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

            – Royi Namir
            Mar 6 at 15:36












          • You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

            – Mark B
            Mar 6 at 15:45











          • Got it. it's AWS that determines how much to fetch up to this max boundry.

            – Royi Namir
            Mar 6 at 15:46






          • 1





            @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

            – Michael - sqlbot
            Mar 7 at 9:05
















          Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

          – Royi Namir
          Mar 6 at 15:36






          Thanks , but How come AWS gives me only 1 message , while I have 5 in queue (while I'm explicitly asking for 5)? i.imgur.com/n3XVtGa.jpg

          – Royi Namir
          Mar 6 at 15:36














          You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

          – Mark B
          Mar 6 at 15:45





          You can't explicitly ask SQS for 5. You are most likely setting the Max messages to 5, but that doesn't guarantee you will get 5, it just guarantees you will never get more than 5. What are you setting WaitTimeSeconds to? If that is very low it may be affecting how SQS is bundling up messages for you.

          – Mark B
          Mar 6 at 15:45













          Got it. it's AWS that determines how much to fetch up to this max boundry.

          – Royi Namir
          Mar 6 at 15:46





          Got it. it's AWS that determines how much to fetch up to this max boundry.

          – Royi Namir
          Mar 6 at 15:46




          1




          1





          @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

          – Michael - sqlbot
          Mar 7 at 9:05





          @RoyiNamir yes, but you should always set WaitTimeSeconds to 20 unless you have a specific reason not to. Not setting this at all will increase your chances of getting fewer messages or even 0 messages, and setting it does not cause SQS to actually wait that long unless there really are no messages available -- in which case, it will wait that long and then return 0, or will return the next message to arrive immediately upon its arrival. This dramatically reduces operational costs and improves overall performance and should have been the default behavior.

          – Michael - sqlbot
          Mar 7 at 9:05



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026522%2faws-sqs-inserting-a-single-message-but-can-only-fetch-a-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved