Kinae commented on a change in pull request #5121: URL: https://github.com/apache/camel/pull/5121#discussion_r585647958
########## File path: components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConsumer.java ########## @@ -17,102 +17,90 @@ package org.apache.camel.component.slack; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; +import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Queue; +import com.slack.api.Slack; +import com.slack.api.methods.SlackApiException; +import com.slack.api.methods.response.conversations.ConversationsHistoryResponse; +import com.slack.api.methods.response.conversations.ConversationsListResponse; +import com.slack.api.model.Conversation; +import com.slack.api.model.Message; import org.apache.camel.Exchange; -import org.apache.camel.Message; import org.apache.camel.Processor; import org.apache.camel.RuntimeCamelException; -import org.apache.camel.component.slack.helper.SlackMessage; import org.apache.camel.support.ScheduledBatchPollingConsumer; import org.apache.camel.util.CastUtils; import org.apache.camel.util.ObjectHelper; -import org.apache.camel.util.json.DeserializationException; -import org.apache.camel.util.json.JsonArray; -import org.apache.camel.util.json.JsonObject; -import org.apache.camel.util.json.Jsoner; -import org.apache.http.HttpResponse; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.message.BasicNameValuePair; - -import static org.apache.camel.component.slack.utils.SlackUtils.readResponse; public class SlackConsumer extends ScheduledBatchPollingConsumer { - private SlackEndpoint slackEndpoint; + private final SlackEndpoint slackEndpoint; + private Slack slack; private String timestamp; private String channelId; - private CloseableHttpClient client; - public SlackConsumer(SlackEndpoint endpoint, Processor processor) throws IOException, DeserializationException { + public SlackConsumer(SlackEndpoint endpoint, Processor processor) { super(endpoint, processor); this.slackEndpoint = endpoint; } @Override protected void doStart() throws Exception { - this.client = HttpClientBuilder.create().useSystemProperties().build(); + this.slack = Slack.getInstance(); Review comment: Mistake, thank you ! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org