jeudi 19 mars 2015

Gateway + ServiceActivator without poller

I like the way SI allows for making transparent proxies to channels using @Gateway and @ServiceActivator.


I was looking at http://ift.tt/1Cuujn4. There are two types of channels:



  • Pollable (Queue, Priority, Rendezvous)

  • Subscribable (Direct, Executor, PublishSubscribe)


Looking at these, it looks to me that all of these are made so that one of the below is true:



  • The receiver polls

  • The sender blocks

  • The messages can be processed by multiple threads at once


Is there a way to configure / use SI in a way that:



  • Sender sends to a queue and does not block (unless obviously the queue is full)

  • Receiver takes from the queue, but does not poll


Pretty much like put / take from BlockingQueue from Java itself.


Am I overlooking some constraint here? Also, if there are other alternatives in Spring for what I'm trying to do (basically asynchronous event bus) with a similar interface (i.e. not having to manually send messages, but having it in a transparent way using interfaces), I'd be glad to hear about them.


Aucun commentaire:

Enregistrer un commentaire