簡體   English   中英

將流引用與Java組件m子相關

[英]relate a flow ref to java component mule

我有一個主要流程,該流程以http端點開始,然后是實現接口的soap組件,然后是實現此接口的java組件1。 現在,我想添加一個流引用,並在其后添加一個實現相同接口的java組件2。 我遇到了“找不到入口點”的問題,我現在正在關注本教程blogs.mulesoft.org/mule-school-invoking-component-methods-using-entry-point-resolvers/

下面是我的流程。

<flow name="CreateAccountFlow1" doc:name="CreateAccountFlow1"> 
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" 
            doc:name="HTTP" path="bank"/> 
    <cxf:jaxws-service doc:name="SOAP" serviceClass="com.essai2.AccountService"/> 
    <component class="com.essai2.AccountRequest" doc:name="Java"/> 
    <logger level="INFO" doc:name="Logger"/> 
    <flow-ref name="Projet2Flow1" doc:name="Flow Reference"/> 
    <component class="com.essai2.AccountResponse" doc:name="Java"/> 
    <logger level="INFO" doc:name="Logger"/> 
</flow>

誰能幫我?

In mule there are many ways to invoke a Java component.

1. Entry point resolver 
2. Implemnt mule Life Cycle API i.e callable
3. Invoke component.

when ever Mule finds Java component as message processors in a flow, tries to execute above three methods .

In the java component if you have created any methods with param same as mule message payload , Entry Point resolver is used.

eg :  class XYZ{
      method1(String s1){

      }
      method2(List<String> S2){
      }
}

If Mule Message Payload has type String then method1 is invoked, if message payload has List of String , method2 is invoked during run time.

2. If you can invoke the Java component in the flow irrespective of type of the payload, should implement Callable interface which overrides onCall() method.

for eg : class XYS implements Callable{
  @override 
  onCall(MuleEventConext muleEventConext){

} 

using MuleEvent Conext you can extract the payload and process it.

3. Using Invoke component, you can create the object of the Class and invoke explicitly the method with appropriate Parameters passed.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM