Announcement Announcement Module
Collapse
No announcement yet.
DI : Dispatcher has no subscribers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DI : Dispatcher has no subscribers

    wrote a @Test for my si:gateway : works fine

    now i wanted to use this gateway :

    Code:
    @Resource
    CriteriaGateway cg;
    	
    @PostConstruct
    void postConstruct() {
    cg.read();}
    at this point : throws MessageDeliveryException,

    removed @PostConstruct and now no problem with :
    Code:
    public void onApplicationEvent(ContextRefreshedEvent event) {
    			postConstruct();
    		}
    how can i postpone any methodcalls until si is ready ?

  • #2
    You shouldn't be sending messages before the whole system is up. @PostConstruct is part of the initialization, not the use of the system, so it should not be sending messages.

    If you need a messaging system from @PostConstruct it is a different system then the one you're still constructing. You could do this by creating a parent context containing the messaging system and reusing it in the system you're starting... I'm not sure if that wouldn't add too much complexity.

    Comment

    Working...
    X