#registerSingleton but for scope
1 messages · Page 1 of 1 (latest)
<@&1004656351647117403> please have a look, thanks.
hey there
can you provide some introduction about ur spring system please ?
btw maybe you need to use @Order
I have a dynamic statistics calculation system, based on a connection with rabbitmq. That is, consumers are created at runtime. In order not to worry once again about the fact that some objects will go in the wrong place, I created my own scope. But I can't start building dependencies without a few objects: a StreamListenerContainer, and a couple of lines. Actually, I want to somehow place it in scope.
Technically I can do something like
@Bean
@Scope("custom")
public Object setObj(Object obj) {
return obj;
}
and via getBean request a value passing a parameter,
but it looks kind of strange
Detected code, here are some useful tools:
@Bean
@Scope("custom") public Object setObj(Object obj) {
return obj;
}