<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: nested cMassegeRouter_1 component not working in a route in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375078#M137562</link>
    <description>After some re-fresh-thinking, &amp;nbsp; I used the component "cSplitter" &amp;nbsp;so as&amp;nbsp;to avoid the nested&amp;nbsp;cMassegeRouter components.&amp;nbsp;
&lt;BR /&gt;I managed to make only the "DELETE" working.&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://community.talend.com/legacyfs/online/288558/new.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGe8.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131698i3A2083B3DAFF45CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGe8.png" alt="0683p000009MGe8.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
    <pubDate>Tue, 11 Aug 2015 10:57:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-08-11T10:57:44Z</dc:date>
    <item>
      <title>nested cMassegeRouter_1 component not working in a route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375075#M137559</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;BR /&gt;I'm facing a problem that seems to my supervisor to, eventually, be a bug in TOS :-/, or maybe I'm just using the wrong components&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I wanted to &amp;nbsp;set a condition on the http verb, if it's a GET, then..., if it's a POST, then ... so I used a cMassegeRouter_1 component with the condition "${header." + org.apache.camel.Exchange.HTTP_METHOD + "} == 'GET'" , I had three "when" branches" and I had what I wanted, everything worked just fine (please see route1 attached bellow)&lt;BR /&gt;After that I put another cMessageRouter component in every when, so as to print a different message depending &amp;nbsp;on the HTTP response code, using the condition&amp;nbsp;"${header." + org.apache.camel.Exchange.HTTP_RESPONSE_CODE + "} == 200 " (please see route2 attached below)&amp;nbsp;&lt;BR /&gt;Now my route behaves&amp;nbsp;weirdly; exemple:&amp;nbsp;&lt;BR /&gt;when I run a DELETE&amp;nbsp;request, the test is as follows:&lt;BR /&gt;-The route made me pass by the customer "Get", passes through the cMessageRouter_2, display a code "200 " &amp;nbsp;and then stops instead of making me pass by the branch "when2" which corresponds to a request "delete".&lt;BR /&gt;&amp;nbsp;The if / else nested does not work depending on the corresponding logic to the graph.The branch "when2" is called only when the two conditions "when4" and "when5" are false (dspite the fact that in my Rest Client, the http verb is "DELETE".&amp;nbsp;&lt;BR /&gt;When I looked into the code, it appers that it's a little bit messy:&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;	from(uriMap.get("cHttp_3"))&lt;BR /&gt;&lt;BR /&gt;				.routeId("Base_cHttp_3")&lt;BR /&gt;				.choice()&lt;BR /&gt;				.id("cMessageRouter_1")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header." + org.apache.camel.Exchange.HTTP_METHOD&lt;BR /&gt;						+ "} == 'GET'")&lt;BR /&gt;&lt;BR /&gt;				.setHeader("CamelHttpMethod", constant("GET"))&lt;BR /&gt;				.to(uriMap.get("cHttp_4"))&lt;BR /&gt;&lt;BR /&gt;				.id("cHttp_4")&lt;BR /&gt;				.choice()&lt;BR /&gt;				.id("cMessageRouter_2")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 200 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.INFO,&lt;BR /&gt;						"chouetteRoute.cLog_1", "good")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_2")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 200 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.ERROR,&lt;BR /&gt;						"chouetteRoute.cLog_1", "eRREUR")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_9")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header." + org.apache.camel.Exchange.HTTP_METHOD&lt;BR /&gt;						+ "} == 'POST'")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.ERROR,&lt;BR /&gt;						"chouetteRoute.cLog_7",&lt;BR /&gt;						"fhjjytyutttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_7")&lt;BR /&gt;				.setHeader("CamelHttpMethod", constant("POST"))&lt;BR /&gt;				.setHeader("Content-Type", constant("application/json"))&lt;BR /&gt;				.to(uriMap.get("cHttp_7"))&lt;BR /&gt;&lt;BR /&gt;				.id("cHttp_7")&lt;BR /&gt;				.choice()&lt;BR /&gt;				.id("cMessageRouter_4")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 200 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.INFO,&lt;BR /&gt;						"chouetteRoute.cLog_1", "good")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_5")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 404 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.ERROR,&lt;BR /&gt;						"chouetteRoute.cLog_1", "eRREUR")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_6")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header." + org.apache.camel.Exchange.HTTP_METHOD&lt;BR /&gt;						+ "} == 'DELETE'")&lt;BR /&gt;&lt;BR /&gt;				.setHeader("CamelHttpMethod", constant("DELETE"))&lt;BR /&gt;				.to(uriMap.get("cHttp_1"))&lt;BR /&gt;&lt;BR /&gt;				.id("cHttp_1")&lt;BR /&gt;				.choice()&lt;BR /&gt;				.id("cMessageRouter_3")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 200 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.INFO,&lt;BR /&gt;						"chouetteRoute.cLog_1", "good")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_3")&lt;BR /&gt;				.when()&lt;BR /&gt;				.simple("${header."&lt;BR /&gt;						+ org.apache.camel.Exchange.HTTP_RESPONSE_CODE&lt;BR /&gt;						+ "} == 404 ")&lt;BR /&gt;				.log(org.apache.camel.LoggingLevel.ERROR,&lt;BR /&gt;						"chouetteRoute.cLog_1", "eRREUR")&lt;BR /&gt;&lt;BR /&gt;				.id("cLog_4");&lt;BR /&gt;	}&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;It's not clear which ".when(...)" is related to which ".choice()"&lt;/STRONG&gt;, and I think that that's what causes the weird behavior of my route.&amp;nbsp;&lt;BR /&gt;Thank you for your suggestions and your time.&amp;nbsp;&lt;BR /&gt;-Regards&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.talend.com/legacyfs/online/288558/rest-Client.png" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGe3.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148148i1BC25862AC4D4BFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGe3.png" alt="0683p000009MGe3.png" /&gt;&lt;/span&gt; &lt;/A&gt;&lt;A href="https://community.talend.com/legacyfs/online/288558/Route1.png" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGda.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129000iE6C962AB62F9F379/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGda.png" alt="0683p000009MGda.png" /&gt;&lt;/span&gt; &lt;/A&gt;&lt;A href="https://community.talend.com/legacyfs/online/288558/Route2.png" target="_blank" rel="noopener"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGZ4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143597i58467730C34F58A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGZ4.png" alt="0683p000009MGZ4.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375075#M137559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-07T16:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: nested cMassegeRouter_1 component not working in a route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375076#M137560</link>
      <description>* Sorry, I posted the same issue twice, I don't know how to delete one&amp;nbsp; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:43:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375076#M137560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-07T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: nested cMassegeRouter_1 component not working in a route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375077#M137561</link>
      <description>I thought about adding a "cStop" &amp;nbsp;component after the tLogs, but wit no result.&amp;nbsp;</description>
      <pubDate>Tue, 11 Aug 2015 10:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375077#M137561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-11T10:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: nested cMassegeRouter_1 component not working in a route</title>
      <link>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375078#M137562</link>
      <description>After some re-fresh-thinking, &amp;nbsp; I used the component "cSplitter" &amp;nbsp;so as&amp;nbsp;to avoid the nested&amp;nbsp;cMassegeRouter components.&amp;nbsp;
&lt;BR /&gt;I managed to make only the "DELETE" working.&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://community.talend.com/legacyfs/online/288558/new.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGe8.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131698i3A2083B3DAFF45CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGe8.png" alt="0683p000009MGe8.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Tue, 11 Aug 2015 10:57:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/nested-cMassegeRouter-1-component-not-working-in-a-route/m-p/2375078#M137562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-11T10:57:44Z</dc:date>
    </item>
  </channel>
</rss>

