IMHO, I think that then you must have two instances of ServiceMix, and make 
the Queue/Topic clustered, using the peer:// protocol. Then, in the other 
instance, you receive and happily process this message.
Am I Missing something ? Please, let me know.



"Barry Kaplan" <[EMAIL PROTECTED]> wrote in 
message news:[EMAIL PROTECTED]
I'll try to answer my own question...

I've got two logical components, lets suppose they are JBI 
components/unit/assemblies (I don't fully understand the differences just 
yet). Each component has internal structure and flow, for example:

C1:

C1.1 receives messages from jms queue and dispatches to C1.2

C1.2 translates message content into a representation suitable for C1 and 
dispatches to C1.3

C1.3 validates the message and, based on message contents, invokes the 
apprioriate pojo method on C1.4 (where the args have been extracted from the 
message)

C1.4 performs business logic and sends a regular java-bean event
C1.5 is subscribed as a listener to C1.4 java-bean events, receives an event 
and publishes it on the appropriate jms topic/queue
Lets say C2 has some similar internal structure.

I want to use be able to instantiate, say 10 threads to dispatch to C1 and 
30 threads to dispatch to C2 (because C2 is slower).

My attempt to translate this into JBI/ServiceMix:

C1:

C1.1 org.servicemix.components.jms.JmsInUsingJCABinding (this needs to be a 
transacted consumer of the queue). The normalized message is then dispatched 
to C1.2.
C1.2 is a subclass of TransformComponentSupport. Translate the message 
contents into the C1 reprentation. Forwards the message to C1.3.
C1.3 maybe just a pojo that extends ComponentSupport, after some validation 
decides what method on C1.4 to invoke.

C1.4 is just a regular spring bean that implements the business logic. It 
has both regular sync methods (eg, getFoo, queryForBar, setMongle) and void 
methods that send java-bean events. For this example, lets suppose one of 
the latter is invoked by C1.3.
C1.5 has been configured by spring to be a listener of C1.4 java-bean 
events. It builds a normalized message from the java-bean even and published 
via jms. Maybe this class extends JmsInOutBinding.
All of the flow between the C1.* subcomponets are syncronous. System 
throughput is obtained by the JmsInUsingJCABinding configured with its own 
Jencks container with an appropriate number of threads. (Which I hope can be 
tuned at runtime if the queue gets backed up.)

If I used the "maybe" classes above, then I would want a JBI container using 
STF.

Now for the part I'm more confused about. C2 needs to consume the messages 
produced by C1. I could configured C2 just as I did with C1, having C2 
listener to the appopriate queue/topic. But maybe I want C2 get the C1 
messages via seda-flow, jms-flow, or cluster-flow, but never st-flow. So I 
want to be able to connect C2 to the C1 via servicemix.

At this point I'm not even sure what question I need to ask. Maybe I need to 
learn more. But I'll just ask this one thing: In the end I need to be able 
to configure the number of instances (or threads) for C1 and C2 
independently to handle the different load and performance requirements of 
each. I know how to do this with JMS (and now Jencks and Lingo, which are 
great). But I don't see how to do this with ServiceMix.

Sorry for the long and winding post. Feel free to ignore it until I can ask 
more precise question.

-- 
barry kaplan
[EMAIL PROTECTED] 



Reply via email to