<?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: tJava, Error: InputStreamReader cannot be resolved to type in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276992#M52904</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LRI7AAO"&gt;@ris.tan&lt;/A&gt;&amp;nbsp;,&lt;/P&gt; 
&lt;P&gt;As a matter of fact I did solve the problem using &lt;STRONG&gt;tRest&lt;/STRONG&gt; Talend component.&lt;/P&gt; 
&lt;P&gt;In tRest component input values as follows.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;URL&lt;/STRONG&gt; -&amp;gt; put your Webhook link surrounded with double quotes&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;HTTP Headers&lt;/STRONG&gt; -&amp;gt; "Content-type"&amp;nbsp; &amp;nbsp; "application/json"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Accept"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"application/json"&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;HTTP Body&lt;/STRONG&gt; -&amp;gt; &lt;EM&gt;example below&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;"{&lt;BR /&gt;\"text\":\"Talend: Data quality check performed at "+context.vCurrentTimestamp+" on "+context.vSchemaName+"."+context.vStagingObjectName+" object returned *"+((Integer)globalMap.get("glbCntSeverity1"))+"* record(s) with severity Reject :helmet_with_white_cross: and *"+((Integer)globalMap.get("glbCntSeverity2"))+"* record(s) with severity Warning :warning:\"&lt;BR /&gt;}"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you have additional questions, I am here.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2020 08:18:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-18T08:18:33Z</dc:date>
    <item>
      <title>tJava, Error: InputStreamReader cannot be resolved to type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276990#M52902</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt; 
&lt;P&gt;Two weeks ago I started to work with Talend and this community was very helpful to me. Big thanks to everyone.&lt;/P&gt; 
&lt;P&gt;I tried everything with problem I have before posting here so this is my last resort.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My intention is to send messages from Talend to Slack using Webhook. Webhook is set up and tested with:&lt;/P&gt; 
&lt;PRE&gt;curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' &amp;lt;my_Webhook_link&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;For sending message to Slack from Talend I used tJava component with code as follows:&lt;/P&gt; 
&lt;PRE&gt;String strSlackPayload ="{";
strSlackPayload += "\"text\": \"";
strSlackPayload += "Message from Talend. Test 1,2,3...";
strSlackPayload += "\"}";
String line;
StringBuffer jsonString = new StringBuffer();
String urly = "&amp;lt;my_Webhook_link&amp;gt;";
URL obj = new URL(urly);
//escape the double quotes in json string
String payload=strSlackPayload;
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
writer.write(payload);
writer.close();
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
while ((line = br.readLine()) != null) {
    jsonString.append(line);
}
br.close();
connection.disconnect();&lt;/PRE&gt; 
&lt;P&gt;I got most of the code from &lt;A href="http://garpitmzn.blogspot.com/2016/04/talend-integration-with-slack.html" target="_self" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; nice blog post.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Problem is that I am getting error&amp;nbsp;&lt;STRONG&gt;InputStreamReader cannot be resolved to type&lt;/STRONG&gt;.&lt;/P&gt; 
&lt;P&gt;People with Java experience suggested me to add&lt;/P&gt; 
&lt;PRE&gt;import java.io.InputStreamReader;&lt;/PRE&gt; 
&lt;P&gt;to code but it didn't help.&lt;/P&gt; 
&lt;P&gt;It looks like when executing Java through Talend InputStreamReader function does not exist.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you for your feedback.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 13:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276990#M52902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-31T13:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: tJava, Error: InputStreamReader cannot be resolved to type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276991#M52903</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQzYAAW"&gt;@poslanik&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Did you fix the problem ?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have exactly the same.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 07:48:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276991#M52903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-18T07:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: tJava, Error: InputStreamReader cannot be resolved to type</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276992#M52904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LRI7AAO"&gt;@ris.tan&lt;/A&gt;&amp;nbsp;,&lt;/P&gt; 
&lt;P&gt;As a matter of fact I did solve the problem using &lt;STRONG&gt;tRest&lt;/STRONG&gt; Talend component.&lt;/P&gt; 
&lt;P&gt;In tRest component input values as follows.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;URL&lt;/STRONG&gt; -&amp;gt; put your Webhook link surrounded with double quotes&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;HTTP Headers&lt;/STRONG&gt; -&amp;gt; "Content-type"&amp;nbsp; &amp;nbsp; "application/json"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Accept"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"application/json"&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;HTTP Body&lt;/STRONG&gt; -&amp;gt; &lt;EM&gt;example below&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;"{&lt;BR /&gt;\"text\":\"Talend: Data quality check performed at "+context.vCurrentTimestamp+" on "+context.vSchemaName+"."+context.vStagingObjectName+" object returned *"+((Integer)globalMap.get("glbCntSeverity1"))+"* record(s) with severity Reject :helmet_with_white_cross: and *"+((Integer)globalMap.get("glbCntSeverity2"))+"* record(s) with severity Warning :warning:\"&lt;BR /&gt;}"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you have additional questions, I am here.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 08:18:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJava-Error-InputStreamReader-cannot-be-resolved-to-type/m-p/2276992#M52904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-18T08:18:33Z</dc:date>
    </item>
  </channel>
</rss>

