N
N
nuclear_kote2021-07-14 15:40:07
Java
nuclear_kote, 2021-07-14 15:40:07

How to register a spring service at runtime?

In general, the service code is generated through javassist at runtime. you need to put it in a spring somehow

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Orkhan, 2021-07-14
@nuclear_kote

Here is a visual article on the topic:
https://medium.com/@venkivenki4b6/spring-dynamical...
Pay attention to point 4

This can be done in many ways. We will be discussing the following with examples.

    GenericBeanDefinition
    BeanDefinitionBuilder
    BeanFactoryPostProcessor
    BeanDefinitionRegistryPostProcessor

Here, more on the topic:
https://stackoverflow.com/questions/57157396/how-t...

S
Sergey Gornostaev, 2021-07-14
@sergey-gornostaev

Indicate in the context configuration that the desired bean is generated by the factory, and in this factory and generate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question