#registerSingleton but for scope

1 messages · Page 1 of 1 (latest)

iron cedar
#

I create my own scope, but for it to function correctly, I need to put 2 beans before creating all the beans in the scope, as the method does registerSingleton. Is there an analog, but for bins with scope?

green heraldBOT
#

<@&1004656351647117403> please have a look, thanks.

marsh nymph
#

can you provide some introduction about ur spring system please ?

#

btw maybe you need to use @Order

iron cedar
# marsh nymph can you provide some introduction about ur spring system please ?

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

green heraldBOT