Announcement Announcement Module
No announcement yet.
broadcast application events across a cluster? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • broadcast application events across a cluster?

    I'd like to be able to selectively broadcast certain ApplicationEvents across a cluster.

    I think this would be useful whenever you're caching some basic lookup data (e.g. product prices, ) and an administrator changes that info. The administrator would have to make the change through business code that publishes some kind of StaleCacheApplicationEvent. The objects caching the lookup data would listen for the StaleCacheApplicationEvent that's appropriate for their cache, and would retrieve new info upon receiving the event.

    1) Is this possible across a cluster?
    2) Is it wise, cluster or no?

    I can certainly imagine someone saying that the kind of data I'm talking about should simply be in some cluster-aware cache. But I figure that the overhead of a cache that has to continually syncrhonize itself across a cluster will be much greater than the cost of broadcasting a select few ApplicationEvent sacross a cluster. (I also like the idea of this data not being in some generalized data cache, but rather inside objects that are injected into other objects-- for example a ProductPriceSource injected into a Menu object, where the ProductPriceSource listens for ProductPriceStaleCacheApplicationEvent.)

    And I apologize if I'm asking a stupid question that's totally outside the scope of Spring. It might be that I should simply consult the clustering section of my container's documentation. But I'd like, if possible, to do whatever part of this I can in a container-neutral way, and ApplicationEvents seemed like a possibility.

  • #2
    You could probably configure a Spring bean that used JGroups (

    Might be interesting to implement your own org.springframework.context.event.ApplicationEvent Multicaster, e.g. JGroupsApplicationEventMulticaster.


    • #3
      Might be worth looking at Mule as well. It provides lots of features for moving ApplicationEvents around.


      • #4
        About Mule integration with Spring :