diff --git a/.gitignore b/.gitignore index 636d33a..a9b5944 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ src/main/api/.repository/ src/main/api/.gitignore velocity.log target/ -.idea/ \ No newline at end of file +.idea/ +bin/ +.settings/ +.project diff --git a/src/main/java/org/mule/extension/mule/telegram/internal/TelegramConnection.java b/src/main/java/org/mule/extension/mule/telegram/internal/TelegramConnection.java index 59acb4d..c5db40c 100644 --- a/src/main/java/org/mule/extension/mule/telegram/internal/TelegramConnection.java +++ b/src/main/java/org/mule/extension/mule/telegram/internal/TelegramConnection.java @@ -26,7 +26,6 @@ public final class TelegramConnection { private static final Logger LOGGER = LoggerFactory.getLogger(TelegramConnection.class); private TelegramConfiguration genConfig; private HttpClient httpClient; - private HttpRequestBuilder httpRequestBuilder; public TelegramConnection(HttpService httpService, TelegramConfiguration gConfig) { genConfig = gConfig; @@ -37,7 +36,6 @@ public void initHttpClient(HttpService httpService){ HttpClientConfiguration.Builder builder = new HttpClientConfiguration.Builder(); builder.setName("telegram"); httpClient = httpService.getClientFactory().create(builder.build()); - httpRequestBuilder = HttpRequest.builder(); httpClient.start(); } @@ -57,7 +55,7 @@ public InputStream sendMessage(String chatId, String message){ qParams.put("chat_id", chatId); qParams.put("text", message); - HttpRequest request = httpRequestBuilder + HttpRequest request = HttpRequest.builder() .method("GET") .uri(strUri) .queryParams(qParams) @@ -73,6 +71,7 @@ public InputStream sendMessage(String chatId, String message){ } catch (Exception e) { e.printStackTrace(); } + return null; } @@ -86,7 +85,7 @@ public InputStream getUpdates(String chatId, boolean watermark, String lastUpdat qParams.put("offset", lastUpdateId); } - HttpRequest request = httpRequestBuilder + HttpRequest request = HttpRequest.builder() .method("GET") .uri(strUri) .queryParams(qParams) diff --git a/src/main/java/org/mule/extension/mule/telegram/internal/sources/UpdatesListener.java b/src/main/java/org/mule/extension/mule/telegram/internal/sources/UpdatesListener.java index 15d04bd..be17790 100644 --- a/src/main/java/org/mule/extension/mule/telegram/internal/sources/UpdatesListener.java +++ b/src/main/java/org/mule/extension/mule/telegram/internal/sources/UpdatesListener.java @@ -53,6 +53,7 @@ public class UpdatesListener extends PollingSource { @Parameter + @Optional protected String chatId; @Parameter