Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Messaging/Event framework in Spring project

I need a messaging or event framework in my Spring project.

Basic requirements:

  • Single producer/sender, which will create the messages/events
  • Global channel/queue/etc where the producer will send messages into
  • Multiple components should be able to register within this channel/queue, so they can receive the messages/events
  • All components should be able to receive all messages - every message would be visible to all receivers, NOT just to one (first one for example). So single consumer cannot make a message to disappear and be not visible to others
  • Messages should be distributed across all consumers asynchronous way, so all of them can receive messages at the same time, not just each after other

What would the best fit for my needs?

like image 839
Laimoncijus Avatar asked Apr 13 '12 16:04

Laimoncijus


2 Answers

I think your requirements meet the features of Spring Integration.

http://www.springsource.org/spring-integration

like image 91
Arnaud Gourlay Avatar answered Sep 21 '22 16:09

Arnaud Gourlay


Spring has native support for Observer pattern (Look at Events section). Check if it meets your needs. If it doesn't then you can use Spring's JMS support + ActiveMQ.

like image 34
Aravind Yarram Avatar answered Sep 18 '22 16:09

Aravind Yarram