-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
I use
org.telegram
telegrambots-springboot-longpolling-starter
9.2.0
public class TelegramBotRequest implements SpringLongPollingBot,LongPollingSingleThreadUpdateConsumer {
,,,,,
}
The bot works fine, but when I want to stop the Spring application. The bot doesn't let me do it. To shut down the application, I use
((ConfigurableApplicationContext) context).close();
or SpringApplication.exit(context);
I tried to use
telegrambots-longpolling
TelegramBotsLongPollingApplication botsApplication;
...
botsApplication = new TelegramBotsLongPollingApplication();
botsApplication.registerBot(botToken, telegramBotRequest);
And shut down the application
botsApplication.stop();
botsApplication.close();
((ConfigurableApplicationContext) context).close();
But the result is the same. The bot doesn't allow me to close the application. As soon as I remove the bot, the application closes in both cases. Could you please tell me how to close the Spring application with the bot?