No subject


Sat Nov 12 19:29:10 PST 2005


s,
routing, senders and messages. The receivers and senders could be of
different types, i.e. FTP, File, Socket and so on. The routing is based=
 on
relating a sender to a receiver, relating a message to a sender or rela=
ting
a content (email perhaps) of a message to a sender.

Moreover, every sender has its demands on the form of what they are
receiving. So, before sending there is a need for transforming the mess=
age
(from raw to xml or the other way around, or to different appearances).=
 One
thinkable solution is xls.

The basic steps are the following:

receive -> transform (if needed to in-house) -> validate -> transform (=
if
needed) -> route -> send

Data-flow:
As I understand it one could use the data-flow approach. Each stage
transforms or process data and pushes the result to the next step in th=
e
chain. Of course, the last steps transform and send, as it could be man=
y
senders involved, needs to be a shared resource and a singleton. The
advantage with this strategy is that it is fairly simple and the number=
 of
threads are at minimal, one thread per chain.  The disadvantage is that=
 it
will take a fairly amount of time to start receiving again. However thi=
s is
not a problem (it is rather the general throughput).

Event-driven and Data-flow:
One could also combine the data-flow with an event-driven approach. Whe=
n
one receives a message one pushes the message to a dispatcher, which st=
arts
a handler (new thread) for this message. Conceptually it would look
something like this:

Receive -> Dispatch -> Handler x

Handler x (transform, validate, transform, route, send)

Basically this is a question of splitting the stages and getting a maxi=
mal
throughput in receiving, but as I stated before this not a demand.
Moreover, the number of threads in use would increase in relation the
data-flow approach, which of course consumes more resources. But it giv=
es,
in my mind, a better separation.

The main question I have is the general throughput through the whole sy=
stem
and if above thoughts make sense. Or, should I view this in another way=
?

Thanks in advance, Theis.

=





More information about the Advanced-java mailing list