Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在java类中读取来自mule的消息_Java_Mule_Mule Studio - Fatal编程技术网

在java类中读取来自mule的消息

在java类中读取来自mule的消息,java,mule,mule-studio,Java,Mule,Mule Studio,如何在java类中读取 我的配置是: <flow name="file-processFlow3" doc:name="file-processFlow3"> <jms:inbound-endpoint doc:name="JMS" queue="OrchestratorQueue" connector-ref="Active_MQ1" responseTimeout="0" > <jms:transaction action

如何在java类中读取

我的配置是:

<flow name="file-processFlow3" doc:name="file-processFlow3">
        <jms:inbound-endpoint doc:name="JMS" queue="OrchestratorQueue" connector-ref="Active_MQ1" responseTimeout="0" >
            <jms:transaction action="ALWAYS_BEGIN" timeout="10000"/>
        </jms:inbound-endpoint>
        <object-to-string-transformer doc:name="Object to String"/>
        <component doc:name="Java"/>
        <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>

我不知道如何读取java类中的输入消息(
)。假设任何类,我还没有实现,我不知道如何实现。 请任何人帮忙


谢谢。

如果类中只有一个方法,它将被自动调用

流量:

如果您需要更复杂的东西,您可以定义入口点、工厂等

更新:

对于具有多个方法的类,需要定义入口点解析器。最简单的方法是使用方法名称:

<component doc:name="Java" class="my.test.Klass">
    <method-entry-point-resolver>
        <include-entry-point method="methhod" />
    </method-entry-point-resolver>
</component>

更新了多重方法案例的答案。
package my.test;

public class Klass {

    public String methhod (String s) {
        return "hello "+s;
    }
}
<component doc:name="Java" class="my.test.Klass">
    <method-entry-point-resolver>
        <include-entry-point method="methhod" />
    </method-entry-point-resolver>
</component>