On 10/6/06, dadade <[EMAIL PROTECTED]> wrote:

I am trying to understand how ServiceMix works with JMS and
WS-Notification/Web Service.
The questions I am asking might be stupid, but just trying to understand.

Looking at the loan broker example:

The LOANBROKER_NS is the namespace, does this has to be a accessable URI?

The line :
 super(new QName(Constants.LOANBROKER_NS, Constants.LOANBROKER_SERVICE),
"input");

Is "input" the endpoint? Where is input begin defined?  Is it a reserved
keyword?

"input" is indeed the endpoint name, but in the configuration, only the service
name is specified for routing.

<sm:activationSpec componentName="loanBrokerJmsBinding"
                                     destinationService="lb:loan-broker">

so the endpoint name is not used in this case


I am looking at the Interaction between JmsServiceComponet to LoanBroker.
So after
loan broker process the input request, it is send out to Credit Agency by
invoking send(inout).  How is send(inout) invoke the transform method in the
CreditAgency class?

Lightweight components implements the MessageExchangeListener.
All jbi exchanges sent to a component go to the onMessageExchange
method.  The loanbroker sends an InOut exchange asynchronously
to the specified service using
new QName(Constants.LOANBROKER_NS, Constants.CREDITAGENCY_SERVICE)
The JBI NMR will send the exchange to the matching service name:

<sm:activationSpec componentName="creditAgency"
                                     service="lb:credit-agency">

which is the loanbroker.CreditAgency component.
This component extends TransformComponentSupport and thus will receive
the request in its transform method.


Then if I look at the CreditAgency class, the transform method takes
MessageExchange exchange, NormalizedMessage in, and NormalizedMessge out as
arguments.  Which argument in the transform method does the Inout inout
refers to?

InOut, InOnly, RobustInOnly and InOptionalOut are all interfaces
deriving from MessageExchange.  So the inout exchange sent by the
loanbroker is received in the "exchange" parameter.  The "msg" message
created by the loanbroker (which is the "in" message of the InOut exchange)
is mapped to the "in" parameter of the transform method.  The "out"
parameter is created by the TransformComponentSupport.


Why doesn't the CreditAgency class need to extends ComponentSupport but just
the TransformComponentSupport?

TransformComponentSupport  extends ComponentSupport and provides additional
methods to ease the writing of simple components that mainly support a
request / response pattern.  The loan broker is more complicated, so it can
not benefit from the implementation of TransformComponentSupport.

The main difference is that the CreditAgency only acts as a provider
(it receives a jbi exchange, process it and send it back), whereas
the loanbroker acts as both a provider and a consumer (it creates
exchange and send them to other components).


Why doesn't the CreditAgency class need the onMessageExchange method?

Because it is implemented by the TransformComponentSupport

http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-core/apidocs/org/apache/servicemix/components/util/package-frame.html
http://incubator.apache.org/servicemix/dist/servicemix-3.0-incubating/site/servicemix-core/xref/org/apache/servicemix/components/util/TransformComponentSupport.html

As can see, TransformComponentSupport implements the onMessageExchange
and derived classes just need to implement the transform method.


Thanks
--
View this message in context: 
http://www.nabble.com/JMS-Implementation-tf2392384.html#a6670308
Sent from the ServiceMix - User mailing list archive at Nabble.com.




--
Cheers,
Guillaume Nodet

Reply via email to