0

I have Spring Boot with Kotlin app which uses Bolt (slack api for Java). I need to fetch data from external resource during AppHomeOpenedEvent. I would like to use FeignClient but problem is that during there is no external resource call and during debugging nothing happens (even if I try to call some random fake api found on the internet). With RestTemplate everything works fine. Is there any limitation with usage of slack api and openfeign?

ketrab321
  • 541
  • 2
  • 12
  • 22

1 Answers1

0

Ok there was a problem with configuration

@Configuration
class SlackAppConfig {

    @Bean
    fun slackApp(appConfig: AppConfig): App {
        return App(appConfig)
    }

    @Bean
    fun slackAppServer(app: App): SlackAppServer {
        val server = SlackAppServer(app)
        server.start()
        return server
    }
}

Looks like SlackAppServer somehow causes that FeignClient cannot be used. After changing config to

@Configuration
class SlackAppConfig {

    @Bean
    fun loadOAuthConfig(): AppConfig {
        return AppConfig.builder()
            //some config
            .build()
    }

    @Bean
    fun slackApp(appConfig: AppConfig): App {
        return App(appConfig)
    }
}

started working

ketrab321
  • 541
  • 2
  • 12
  • 22