shardingsphere-elasticjob icon indicating copy to clipboard operation
shardingsphere-elasticjob copied to clipboard

How do elasticjob listeners inject beans in spring?

Open kaihekaihe opened this issue 3 years ago • 1 comments

Feature Request

For English only, other languages will not accept.

Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot make decision by current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Is your feature request related to a problem?

Describe the feature you would like.

In the elasticjob 3.0.0-RC1,the listeners are instanced by spi,the beans in spring can not be injected into the listener instance. eg. @Autowired works in spring doesnot work in instance of ElasticJobLIstener

kaihekaihe avatar Apr 27 '21 03:04 kaihekaihe

Hi @kaihekaihe The listener doesn't support inject spring beans for now. Consider lazily retrieving beans by some static context holder. We're thinking about that replace SPI factory with Spring containers if the Spring dependencies present.

TeslaCN avatar Apr 27 '21 13:04 TeslaCN