HandleHTTPRequest processor creating duplicate output flowfiles in nifi












3















​Hi,
I have created the handlehttprequest processor, on a standalone nifi instance which is timer driven, concurrent tasks set to 1 and run schedule is 0. I am hitting my web service with a request from postman or any browser. The output queue of the processor has one entry initially but it becomes 2 after around a minute. I have seen this issue on a single node as well as on a clustered nifi instance. Can someone give any pointers



Nifi Version: 1.7.0



Update 1: I have observed that in case the http response flow is not reached within a certain time a new http request is generated wit the same parameters. Is this expected?, if yes how can I avoid this?



Update 2: We have seen that the second flow file gets generated after exactly 60 seconds. Not sure which configuration sets this.



Update 3: I just saw that the StandardHttpContextMap that we use has a property: Request Expiration which is set to 1 min by default. The documentation states that "Specifies how long an HTTP Request should be left unanswered before being evicted from the cache and being responded to with a Service Unavailable status code". If I increase this value I can see that I dont see any other duplicate values. So now I know why this is happening, but not sure as to why this is acting like this. Why am I getting another entry in the forward queue.










share|improve this question





























    3















    ​Hi,
    I have created the handlehttprequest processor, on a standalone nifi instance which is timer driven, concurrent tasks set to 1 and run schedule is 0. I am hitting my web service with a request from postman or any browser. The output queue of the processor has one entry initially but it becomes 2 after around a minute. I have seen this issue on a single node as well as on a clustered nifi instance. Can someone give any pointers



    Nifi Version: 1.7.0



    Update 1: I have observed that in case the http response flow is not reached within a certain time a new http request is generated wit the same parameters. Is this expected?, if yes how can I avoid this?



    Update 2: We have seen that the second flow file gets generated after exactly 60 seconds. Not sure which configuration sets this.



    Update 3: I just saw that the StandardHttpContextMap that we use has a property: Request Expiration which is set to 1 min by default. The documentation states that "Specifies how long an HTTP Request should be left unanswered before being evicted from the cache and being responded to with a Service Unavailable status code". If I increase this value I can see that I dont see any other duplicate values. So now I know why this is happening, but not sure as to why this is acting like this. Why am I getting another entry in the forward queue.










    share|improve this question



























      3












      3








      3


      1






      ​Hi,
      I have created the handlehttprequest processor, on a standalone nifi instance which is timer driven, concurrent tasks set to 1 and run schedule is 0. I am hitting my web service with a request from postman or any browser. The output queue of the processor has one entry initially but it becomes 2 after around a minute. I have seen this issue on a single node as well as on a clustered nifi instance. Can someone give any pointers



      Nifi Version: 1.7.0



      Update 1: I have observed that in case the http response flow is not reached within a certain time a new http request is generated wit the same parameters. Is this expected?, if yes how can I avoid this?



      Update 2: We have seen that the second flow file gets generated after exactly 60 seconds. Not sure which configuration sets this.



      Update 3: I just saw that the StandardHttpContextMap that we use has a property: Request Expiration which is set to 1 min by default. The documentation states that "Specifies how long an HTTP Request should be left unanswered before being evicted from the cache and being responded to with a Service Unavailable status code". If I increase this value I can see that I dont see any other duplicate values. So now I know why this is happening, but not sure as to why this is acting like this. Why am I getting another entry in the forward queue.










      share|improve this question
















      ​Hi,
      I have created the handlehttprequest processor, on a standalone nifi instance which is timer driven, concurrent tasks set to 1 and run schedule is 0. I am hitting my web service with a request from postman or any browser. The output queue of the processor has one entry initially but it becomes 2 after around a minute. I have seen this issue on a single node as well as on a clustered nifi instance. Can someone give any pointers



      Nifi Version: 1.7.0



      Update 1: I have observed that in case the http response flow is not reached within a certain time a new http request is generated wit the same parameters. Is this expected?, if yes how can I avoid this?



      Update 2: We have seen that the second flow file gets generated after exactly 60 seconds. Not sure which configuration sets this.



      Update 3: I just saw that the StandardHttpContextMap that we use has a property: Request Expiration which is set to 1 min by default. The documentation states that "Specifies how long an HTTP Request should be left unanswered before being evicted from the cache and being responded to with a Service Unavailable status code". If I increase this value I can see that I dont see any other duplicate values. So now I know why this is happening, but not sure as to why this is acting like this. Why am I getting another entry in the forward queue.







      apache-nifi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 24 '18 at 14:59







      Sid

















      asked Nov 24 '18 at 13:03









      SidSid

      4131634




      4131634
























          2 Answers
          2






          active

          oldest

          votes


















          3














          You are missing the HandleHttpResponse processor. Once you read the request from the HandleHttpRequest processor you must send a response back to the client (In this case postman). If postman doesn't get any response within 60 seconds it will retry due to the timeout.



          See this flow built by me.



          enter image description here



          HandleHttpResponse processor's success queue will have the same flow file. Sometimes you might need to do a certain operation before you send the response to the client. In that case do not directly connect the HandleHttpResponse Processor directly to HandleHttpRequest processor. Once you have completed the operation, make sure you send the response to the client using HandleHttpResponse processor before the timeout.






          share|improve this answer

































            0














            I also had the same problem. I used HandleHttpResponse immediately but it didn't prevent second flow for me. After some research, I've found that most browsers make a second connection. I don't have any problem when I try it with SOAP UI or Postman, so I am sure my case was about browsers.
            We may need to fiddle HandleHttpRequest's scheduling parameters or we can use DetectDuplicate processor to prevent executing second call.



            Edit: I've investigated the issue a bit more and I've found that one of the request has "http://localhost:8011/favicon.ico" value for "http.request.url" attribute and other one has "http://localhost:8011".






            share|improve this answer

























              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%2f53458421%2fhandlehttprequest-processor-creating-duplicate-output-flowfiles-in-nifi%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              You are missing the HandleHttpResponse processor. Once you read the request from the HandleHttpRequest processor you must send a response back to the client (In this case postman). If postman doesn't get any response within 60 seconds it will retry due to the timeout.



              See this flow built by me.



              enter image description here



              HandleHttpResponse processor's success queue will have the same flow file. Sometimes you might need to do a certain operation before you send the response to the client. In that case do not directly connect the HandleHttpResponse Processor directly to HandleHttpRequest processor. Once you have completed the operation, make sure you send the response to the client using HandleHttpResponse processor before the timeout.






              share|improve this answer






























                3














                You are missing the HandleHttpResponse processor. Once you read the request from the HandleHttpRequest processor you must send a response back to the client (In this case postman). If postman doesn't get any response within 60 seconds it will retry due to the timeout.



                See this flow built by me.



                enter image description here



                HandleHttpResponse processor's success queue will have the same flow file. Sometimes you might need to do a certain operation before you send the response to the client. In that case do not directly connect the HandleHttpResponse Processor directly to HandleHttpRequest processor. Once you have completed the operation, make sure you send the response to the client using HandleHttpResponse processor before the timeout.






                share|improve this answer




























                  3












                  3








                  3







                  You are missing the HandleHttpResponse processor. Once you read the request from the HandleHttpRequest processor you must send a response back to the client (In this case postman). If postman doesn't get any response within 60 seconds it will retry due to the timeout.



                  See this flow built by me.



                  enter image description here



                  HandleHttpResponse processor's success queue will have the same flow file. Sometimes you might need to do a certain operation before you send the response to the client. In that case do not directly connect the HandleHttpResponse Processor directly to HandleHttpRequest processor. Once you have completed the operation, make sure you send the response to the client using HandleHttpResponse processor before the timeout.






                  share|improve this answer















                  You are missing the HandleHttpResponse processor. Once you read the request from the HandleHttpRequest processor you must send a response back to the client (In this case postman). If postman doesn't get any response within 60 seconds it will retry due to the timeout.



                  See this flow built by me.



                  enter image description here



                  HandleHttpResponse processor's success queue will have the same flow file. Sometimes you might need to do a certain operation before you send the response to the client. In that case do not directly connect the HandleHttpResponse Processor directly to HandleHttpRequest processor. Once you have completed the operation, make sure you send the response to the client using HandleHttpResponse processor before the timeout.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 31 at 10:18

























                  answered Nov 28 '18 at 9:30









                  Asanka sanjayaAsanka sanjaya

                  4693826




                  4693826

























                      0














                      I also had the same problem. I used HandleHttpResponse immediately but it didn't prevent second flow for me. After some research, I've found that most browsers make a second connection. I don't have any problem when I try it with SOAP UI or Postman, so I am sure my case was about browsers.
                      We may need to fiddle HandleHttpRequest's scheduling parameters or we can use DetectDuplicate processor to prevent executing second call.



                      Edit: I've investigated the issue a bit more and I've found that one of the request has "http://localhost:8011/favicon.ico" value for "http.request.url" attribute and other one has "http://localhost:8011".






                      share|improve this answer






























                        0














                        I also had the same problem. I used HandleHttpResponse immediately but it didn't prevent second flow for me. After some research, I've found that most browsers make a second connection. I don't have any problem when I try it with SOAP UI or Postman, so I am sure my case was about browsers.
                        We may need to fiddle HandleHttpRequest's scheduling parameters or we can use DetectDuplicate processor to prevent executing second call.



                        Edit: I've investigated the issue a bit more and I've found that one of the request has "http://localhost:8011/favicon.ico" value for "http.request.url" attribute and other one has "http://localhost:8011".






                        share|improve this answer




























                          0












                          0








                          0







                          I also had the same problem. I used HandleHttpResponse immediately but it didn't prevent second flow for me. After some research, I've found that most browsers make a second connection. I don't have any problem when I try it with SOAP UI or Postman, so I am sure my case was about browsers.
                          We may need to fiddle HandleHttpRequest's scheduling parameters or we can use DetectDuplicate processor to prevent executing second call.



                          Edit: I've investigated the issue a bit more and I've found that one of the request has "http://localhost:8011/favicon.ico" value for "http.request.url" attribute and other one has "http://localhost:8011".






                          share|improve this answer















                          I also had the same problem. I used HandleHttpResponse immediately but it didn't prevent second flow for me. After some research, I've found that most browsers make a second connection. I don't have any problem when I try it with SOAP UI or Postman, so I am sure my case was about browsers.
                          We may need to fiddle HandleHttpRequest's scheduling parameters or we can use DetectDuplicate processor to prevent executing second call.



                          Edit: I've investigated the issue a bit more and I've found that one of the request has "http://localhost:8011/favicon.ico" value for "http.request.url" attribute and other one has "http://localhost:8011".







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 2 days ago

























                          answered 2 days ago









                          Turker TunaliTurker Tunali

                          979




                          979






























                              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%2f53458421%2fhandlehttprequest-processor-creating-duplicate-output-flowfiles-in-nifi%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

                              Wiesbaden

                              To store a contact into the json file from server.js file using a class in NodeJS

                              Marschland