how to handle http connector response code 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!Passing a java object to the HTTP ConnectorApikit - status code best practicesMule SFDC connector: redirect_uri_mismatch&error_description=redirect_uri must match configurationMule http connector seems to “eat” variableCustom Mule Cloud Connector with Axis2 ClientHow to get HTTP Status code from MuleMule Https request response timeoutHow send a file in an HTTP request and upload it to file server via FTP in MuleMulesoft Anypoint Studio not showing OAuthUnable to resolve value for the parameter: sql error in Mule database connector

How do living politicians protect their readily obtainable signatures from misuse?

What is the chair depicted in Cesare Maccari's 1889 painting "Cicerone denuncia Catilina"?

How could we fake a moon landing now?

Should a wizard buy fine inks every time he want to copy spells into his spellbook?

In musical terms, what properties are varied by the human voice to produce different words / syllables?

Can a Beast Master ranger change beast companions?

Google .dev domain strangely redirects to https

Does the Mueller report show a conspiracy between Russia and the Trump Campaign?

Getting prompted for verification code but where do I put it in?

Did Mueller's report provide an evidentiary basis for the claim of Russian govt election interference via social media?

How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?

C's equality operator on converted pointers

Why weren't discrete x86 CPUs ever used in game hardware?

Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?

Electrolysis of water: Which equations to use? (IB Chem)

Random body shuffle every night—can we still function?

How many morphisms from 1 to 1+1 can there be?

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

What does this say in Elvish?

How to identify unknown coordinate type and convert to lat/lon?

Trademark violation for app?

Drawing spherical mirrors



how to handle http connector response code



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!Passing a java object to the HTTP ConnectorApikit - status code best practicesMule SFDC connector: redirect_uri_mismatch&error_description=redirect_uri must match configurationMule http connector seems to “eat” variableCustom Mule Cloud Connector with Axis2 ClientHow to get HTTP Status code from MuleMule Https request response timeoutHow send a file in an HTTP request and upload it to file server via FTP in MuleMulesoft Anypoint Studio not showing OAuthUnable to resolve value for the parameter: sql error in Mule database connector



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















Currently in mule, I have a flow process that makes an http connection to elasticsearch. We are using the scroll api and all connections are fine. I am trying to create a flow to handle the 404 status code which would be returned in the event that the scroll_id has expired on a request. At the moment, I added code 404 to the advanced settings for "Failure Status Code Validator" section on the http connector. What I want to accomplish is that when 404 is returned from this particular http call (which we know is due to the scroll_id expiry), we make another http call to another gateway. So when 404, make another http call to a separate link.



Thanks in advance. I am still learning the xml code, but if you have an anypoint studio experience in the GUI that would be extremely helpful.










share|improve this question




























    2















    Currently in mule, I have a flow process that makes an http connection to elasticsearch. We are using the scroll api and all connections are fine. I am trying to create a flow to handle the 404 status code which would be returned in the event that the scroll_id has expired on a request. At the moment, I added code 404 to the advanced settings for "Failure Status Code Validator" section on the http connector. What I want to accomplish is that when 404 is returned from this particular http call (which we know is due to the scroll_id expiry), we make another http call to another gateway. So when 404, make another http call to a separate link.



    Thanks in advance. I am still learning the xml code, but if you have an anypoint studio experience in the GUI that would be extremely helpful.










    share|improve this question
























      2












      2








      2








      Currently in mule, I have a flow process that makes an http connection to elasticsearch. We are using the scroll api and all connections are fine. I am trying to create a flow to handle the 404 status code which would be returned in the event that the scroll_id has expired on a request. At the moment, I added code 404 to the advanced settings for "Failure Status Code Validator" section on the http connector. What I want to accomplish is that when 404 is returned from this particular http call (which we know is due to the scroll_id expiry), we make another http call to another gateway. So when 404, make another http call to a separate link.



      Thanks in advance. I am still learning the xml code, but if you have an anypoint studio experience in the GUI that would be extremely helpful.










      share|improve this question














      Currently in mule, I have a flow process that makes an http connection to elasticsearch. We are using the scroll api and all connections are fine. I am trying to create a flow to handle the 404 status code which would be returned in the event that the scroll_id has expired on a request. At the moment, I added code 404 to the advanced settings for "Failure Status Code Validator" section on the http connector. What I want to accomplish is that when 404 is returned from this particular http call (which we know is due to the scroll_id expiry), we make another http call to another gateway. So when 404, make another http call to a separate link.



      Thanks in advance. I am still learning the xml code, but if you have an anypoint studio experience in the GUI that would be extremely helpful.







      mule mule-studio anypoint-studio mulesoft






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 21:55









      dataviewsdataviews

      19614




      19614






















          1 Answer
          1






          active

          oldest

          votes


















          1














          I accomplished this by setting a success status code validator under the Advanced tab of the http-connector.



          Before setting this value, when getting a 404, the mulesoft would raise its default exception for error code 4xx. At the moment, I still can't figure out how to override that or set something additional, and that could be due to this particular project I am taking over. However, in the success code validator section, I set the values to 200,404 which is saying that a status code of 200 and 404 can pass to the next component in the flow. By default, if you don't set 404, again mulesoft will throw its default built in error message for status code 404. So since I am telling mulesoft to treat this as okay, I can pass to the next component in my project. At the next flow immediately after the outbound http call to an external rest service, I have a choice-component in place that is evaluating what the status code of the http call is. To do this, you can use this: #[message.inboundProperties.'http.status' == '404'] which is saying, use this particular flow path if the status code is 404, else use the default path.



          enter image description here






          share|improve this answer























          • Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

            – jerney
            Mar 12 at 13:45











          • @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

            – dataviews
            Mar 12 at 19:03












          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%2f55071536%2fhow-to-handle-http-connector-response-code%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









          1














          I accomplished this by setting a success status code validator under the Advanced tab of the http-connector.



          Before setting this value, when getting a 404, the mulesoft would raise its default exception for error code 4xx. At the moment, I still can't figure out how to override that or set something additional, and that could be due to this particular project I am taking over. However, in the success code validator section, I set the values to 200,404 which is saying that a status code of 200 and 404 can pass to the next component in the flow. By default, if you don't set 404, again mulesoft will throw its default built in error message for status code 404. So since I am telling mulesoft to treat this as okay, I can pass to the next component in my project. At the next flow immediately after the outbound http call to an external rest service, I have a choice-component in place that is evaluating what the status code of the http call is. To do this, you can use this: #[message.inboundProperties.'http.status' == '404'] which is saying, use this particular flow path if the status code is 404, else use the default path.



          enter image description here






          share|improve this answer























          • Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

            – jerney
            Mar 12 at 13:45











          • @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

            – dataviews
            Mar 12 at 19:03
















          1














          I accomplished this by setting a success status code validator under the Advanced tab of the http-connector.



          Before setting this value, when getting a 404, the mulesoft would raise its default exception for error code 4xx. At the moment, I still can't figure out how to override that or set something additional, and that could be due to this particular project I am taking over. However, in the success code validator section, I set the values to 200,404 which is saying that a status code of 200 and 404 can pass to the next component in the flow. By default, if you don't set 404, again mulesoft will throw its default built in error message for status code 404. So since I am telling mulesoft to treat this as okay, I can pass to the next component in my project. At the next flow immediately after the outbound http call to an external rest service, I have a choice-component in place that is evaluating what the status code of the http call is. To do this, you can use this: #[message.inboundProperties.'http.status' == '404'] which is saying, use this particular flow path if the status code is 404, else use the default path.



          enter image description here






          share|improve this answer























          • Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

            – jerney
            Mar 12 at 13:45











          • @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

            – dataviews
            Mar 12 at 19:03














          1












          1








          1







          I accomplished this by setting a success status code validator under the Advanced tab of the http-connector.



          Before setting this value, when getting a 404, the mulesoft would raise its default exception for error code 4xx. At the moment, I still can't figure out how to override that or set something additional, and that could be due to this particular project I am taking over. However, in the success code validator section, I set the values to 200,404 which is saying that a status code of 200 and 404 can pass to the next component in the flow. By default, if you don't set 404, again mulesoft will throw its default built in error message for status code 404. So since I am telling mulesoft to treat this as okay, I can pass to the next component in my project. At the next flow immediately after the outbound http call to an external rest service, I have a choice-component in place that is evaluating what the status code of the http call is. To do this, you can use this: #[message.inboundProperties.'http.status' == '404'] which is saying, use this particular flow path if the status code is 404, else use the default path.



          enter image description here






          share|improve this answer













          I accomplished this by setting a success status code validator under the Advanced tab of the http-connector.



          Before setting this value, when getting a 404, the mulesoft would raise its default exception for error code 4xx. At the moment, I still can't figure out how to override that or set something additional, and that could be due to this particular project I am taking over. However, in the success code validator section, I set the values to 200,404 which is saying that a status code of 200 and 404 can pass to the next component in the flow. By default, if you don't set 404, again mulesoft will throw its default built in error message for status code 404. So since I am telling mulesoft to treat this as okay, I can pass to the next component in my project. At the next flow immediately after the outbound http call to an external rest service, I have a choice-component in place that is evaluating what the status code of the http call is. To do this, you can use this: #[message.inboundProperties.'http.status' == '404'] which is saying, use this particular flow path if the status code is 404, else use the default path.



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 11 at 18:50









          dataviewsdataviews

          19614




          19614












          • Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

            – jerney
            Mar 12 at 13:45











          • @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

            – dataviews
            Mar 12 at 19:03


















          • Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

            – jerney
            Mar 12 at 13:45











          • @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

            – dataviews
            Mar 12 at 19:03

















          Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

          – jerney
          Mar 12 at 13:45





          Another way to do this, if you're curious, is to catch the exception that is thrown from the 404 and handle it there. Whether you do that or what you've already done depends on the semantics though. Is a 404 an unexpected exception, or a cue to try something different? I think your current code relays that intention well.

          – jerney
          Mar 12 at 13:45













          @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

          – dataviews
          Mar 12 at 19:03






          @jerney, the 404 is expected here for this particular flow. We are using elasticsearch, so the 404 indicates that a particular api we are calling expired (resource no longer available), and we are expecting this to happen after a certain period of time. When I attempted to implement the exception catching, I was running into the issue of "No Listener Found for Endpoint xxx"

          – dataviews
          Mar 12 at 19:03




















          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%2f55071536%2fhow-to-handle-http-connector-response-code%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

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко