Skip to content

Spring Apllication don`t shutdown #1553

@darujo

Description

@darujo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions