Spring 3.0 lazy-init not honoured for DefaultMessageListenerContainer?

后端 未结 2 1381
自闭症患者
自闭症患者 2021-01-21 01:09

I\'ve setup a spring config for JMS. Things work fine, except I can\'t seem to get it to lazy load (notice the default-lazy-init true in the code below). If I comment out the jm

2条回答
  •  不要未来只要你来
    2021-01-21 01:58

    OK, this is pretty obscure, but DefaultMessageListenerContainer implements the Lifecycle interface, and beans that implement this are tied into the context's own lifecycle - when the context starts up, Lifecycle-implementing beans are initialised and started. This means that your lazy-init config is essentially ignored.

提交回复
热议问题