You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The asyncapi and channel retrieval logic is impelemented in @PostConstruct methods inside DefaultAsyncApiService and DefaultChannelService - which means that the asyncapi detection runs during creation of the central spring(boot) context. This has an impact on the startup time of a spring boot application (especially if the scanning scope - springwolf.docket.base-package is large).
I suggest to provide an option to create the asyncapi lazy on first invocation of getAsyncApi. This option could be implemented as 'fail-fast' Property: true = current behavior, false = lazy asyncapi creation.
Motivation
Beside a better startup-performance, there is an additional advantage: we could pass context parameters between DefaultAsyncApiService and DefaultChannelService. This could help to implement additional functionality - for example an early validation of channel annotations against properties provided in a docket. (see additional feature request #293 ).
Technical details
DefaultChannelService becames a stateless service which provides a channel map. @PostConstruct will be removed, the findChannels method will scan for channels and return the resulting map.
DefaultAsyncApiService will cache a created asyncapi. The class supports two modes:
'fail-fast' = true : The detection/creation of asyncapi will run in 'afterPropertiesSet' (synonym to @PostConstruct) - on bean creation. An exception will interrupt the spring context creation (i.e. the application start). The springwolf behavior stays compatible.
fail-fast = false: The detection/creation of asyncapi will run on first invocation of getAsyncApi. An exception during asyncapi creation will be cached and thrown each time getAsyncApi is invoced.
The text was updated successfully, but these errors were encountered:
The asyncapi and channel retrieval logic is impelemented in @PostConstruct methods inside
DefaultAsyncApiService
andDefaultChannelService
- which means that the asyncapi detection runs during creation of the central spring(boot) context. This has an impact on the startup time of a spring boot application (especially if the scanning scope - springwolf.docket.base-package is large).I suggest to provide an option to create the asyncapi lazy on first invocation of
getAsyncApi
. This option could be implemented as 'fail-fast' Property: true = current behavior, false = lazy asyncapi creation.Motivation
Beside a better startup-performance, there is an additional advantage: we could pass context parameters between
DefaultAsyncApiService
andDefaultChannelService
. This could help to implement additional functionality - for example an early validation of channel annotations against properties provided in a docket. (see additional feature request #293 ).Technical details
DefaultChannelService
becames a stateless service which provides a channel map. @PostConstruct will be removed, thefindChannels
method will scan for channels and return the resulting map.DefaultAsyncApiService
will cache a created asyncapi. The class supports two modes:getAsyncApi
. An exception during asyncapi creation will be cached and thrown each timegetAsyncApi
is invoced.The text was updated successfully, but these errors were encountered: