Announcement Announcement Module
No announcement yet.
Single MessageBus check for hierarchical contexts? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Single MessageBus check for hierarchical contexts?

    Should MessageBus.setApplicationContext() be updated to cycle through all parents, if any, of the passed in ApplicationContext to ensure there's only a single MessageBus defined when using hierarchical context configs?

  • #2
    If so, then it's just a matter of replacing the current 'beansOfType' check with BeanFactoryUtils.beansOfTypeIncludingAncestors(..) .

    I think the typical use of a hierarchy would involve the integration components in a child context referencing a service layer in a parent context.

    However, there might be a case for allowing hierarchies where more than one level has a message bus. For example, two sibling contexts could reference channels in a parent context to send/receive... in effect providing an observer pattern of sorts.



    • #3
      Agreed on the typical use case and I see your point. Seems that changing to ensure 1 MessageBus through the hierarchy could be a very bad idea that precludes other interesting usage patterns.