tags:

views:

599

answers:

4

I will be starting a small Java (GWT really) project in the near future and I am at "information gathering" phase.

Q: Is there a lightweight Message Bus library written in Java?

My requirements are lightweight too :-)

  1. async (no need for sync)
  2. multicast and point-to-point
  3. no strict message ordering
  4. message "envelope" ideally "owned" by Message Bus (i.e. in terms of life-cycle management)
  5. localized delivery (i.e. not inter-process nor inter-node)

Update: It seems that GWT now supports an integrated "event bus".

+3  A: 

Have a look at eventbus.

Aaron Digulla
...broken link...
jldupont
link works fine for me
Anthony Forloney
network partition fault then...
jldupont
Does http://www.eventbus.org/ work for you?
Steve K
I was just about to post this too... eventbus is definitely the way to go!
BobMcGee
http://www.eventbus.org/ works for me! Thanks!
jldupont
A: 

Not sure if it is really lightweight. But it does fit the rest of your description: ActiveMQ

Toad
@reinier: I know about AMQP based solutions: (1) not lightweight (of course it is relative ;-) (2) not really applicable for a GWT based project.
jldupont
@jldupont: ah right... it all has to run in the same process in the browser right? Yes in that case ignore this idea ;^)
Toad
@reinier: then delete it as you'll likely get some down-votes at some point (not from me).
jldupont
@jldupont: They tend to do that. ;^) Still my wrong solution does add to the conversation for anyone else who might have come up with the same response
Toad
@reinier: have it your way then. Cheers :-)
jldupont
A: 

Maybe you could try some jabber (XMPP) based solution. What about openfire?

marcospereira
@marcospereira: are you serious? it is not because I don't down-vote (often) that one can abuse here!
jldupont
jldupont: yes, I'm serious. And I can't understand why you consider my comment as an abuse. If you think it is a wrong solution, put some arguments on the table. ;-)
marcospereira
+2  A: 

If you happen to be using Spring already, then a handy sort-of-hidden feature of Spring is the ApplicationEventMulticaster interface, which is a very simple API for publishing and subscribing to application-generated events. The implementations use the TaskExecutor framework, which means they can be sync or async as desired. Furthermore, every ApplicationContext has a publishEvent method, so it's comically easy to set it up for Spring-managed classes.

So yes, if you already use Spring, there's no need to for another utility to do this, it's built in already.

skaffman
+1: many thanks. I won't be using Spring but I always value good information.
jldupont