如果一个项目中有多个流,则会出现子 [英] Mule Issue if Multiple flows in one project

查看:83
本文介绍了如果一个项目中有多个流,则会出现子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,其中创建了10个流程. 其中,有8个流连接到不同的队列.进一步,我正在使用Java转换器进行某些转换,并将转换后的文件放在某个文件夹中.

I have one project in which i created 10 flows. Out of these, 8 flows are connected with different queues. further I am using java transformer for some transformation and putting transformed file at some folder.

不是的问题是所有10个流都在同一时间触发.如果两个队列包含一些数据,则相应的两个流将同时触发.我只想在第一个流停止时触发另一个流,因为在那里没有应用commom java类,因此我没有得到确切的结果.

Noe the issue is all the 10 flows are triggering at a same time. And if 2 queues are containg some data, the corresponding two flows get triggered simultaneously. I want to trigger the other flow only when first flow get stopped because a commom java class has been applied there due to which I am not getting exact results.

我没有流程依赖.这就是为什么,我不能使用流引用.另外,我将处理策略用作最多1个线程,因为我需要从一个队列中一个接一个地处理消息.

I have not flow dependency. That is why, i cant use flow reference. also, i used processing strategy as max 1 thread because i need to process message one by one from one queue.

帮我解决这个问题.这是我的XMl

Help me to resolve this. This is my XMl

      <queued-asynchronous-processing-strategy name="allowOneThread" maxThreads="1" doc:name="Queued Asynchronous Processing Strategy" threadWaitTimeout="2000"/>
<spring:beans>
      <context:property-placeholder location="classpath:mule-app.properties" />
 </spring:beans>
       <wmq:connector name="WMQ" hostName="${wmq.hostname}" port="${wmq.port}" queueManager="${wmq.queue.manager}" username="${wmq.username}" password="${wmq.password}" validateConnections="true" doc:name="WMQ" channel="${wmq.channel}"/>
         <file:connector name="File" autoDelete="false" streaming="true" validateConnections="true" doc:name="File" pollingFrequency="20000"/>
       <flow name="CatalogueFlow_AB" doc:name="CatalogueFlow_AB" processingStrategy="allowOneThread">

    <wmq:inbound-endpoint queue="${wmq.queue.nameCT_AB}" doc:name="WMQ" connector-ref="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.catalog.ServiceController_AB" doc:name="Java"/>
    <logger level="INFO" doc:name="CAT Logger" category="Audit_LogCAT" message="******************Entered Catalogue SOAP File with Province Name AB is Processed from queue*********"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger level="INFO" doc:name="CAT Exception Logger" category="Audit_LogCAT" message="*******************************Entered Catalogue SOAP File with Province Name AB is having error: #[exception.causeException]****************"/>
    </catch-exception-strategy>
</flow>
<flow name="CatalogueFlow_BC" doc:name="CatalogueFlow_BC" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameCT_BC}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.catalog.ServiceController_BC" doc:name="Java"/>
    <logger message="******************Entered Catalogue SOAP File with Province Name BC is Processed from queue*********" level="INFO" category="Audit_LogCAT" doc:name="CAT Logger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered Catalogue SOAP File with Province Name BC is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogCAT" doc:name="CAT Exception Logger"/>
    </catch-exception-strategy>
</flow>
<flow name="CatalogueFlow_ON" doc:name="CatalogueFlow_ON" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameCT_ON}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.catalog.ServiceController_ON" doc:name="Java"/>
    <logger message="******************Entered Catalogue SOAP File with Province Name ON is Processed from queue*********" level="INFO" category="Audit_LogCAT" doc:name="CAT Logger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered Catalogue SOAP File with Province Name ON is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogCAT" doc:name="CAT Exception Logger"/>
    </catch-exception-strategy>
</flow>
<flow name="CatalogueFlow_MB" doc:name="CatalogueFlow_MB" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameCT_MB}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.catalog.ServiceController_MB" doc:name="Java"/>
    <logger message="******************Entered Catalogue SOAP File with Province Name MB is Processed  from queue*********" level="INFO" category="Audit_LogCAT" doc:name="CAT Logger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered Catalogue SOAP File with Province Name MB is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogCAT" doc:name="CAT Exception Logger"/>
    </catch-exception-strategy>
</flow>
<flow name="InterchangablePriority_AB" doc:name="InterchangablePriority_AB" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameIP_AB}" doc:name="WMQ" connector-ref="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.interchangeablePriority.IPController_AB" doc:name="Java"/>
    <logger level="INFO" doc:name="IP Logger" category="Audit_LogIP" message="******************Entered IP SOAP File with Province Name AB is Processed from queue*********"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger level="INFO" doc:name="IP Exception Logger" category="Audit_LogIP" message="*******************************Entered IP SOAP File with Province Name AB is having error: #[exception.causeException]****************"/>
    </catch-exception-strategy>
</flow>
<flow name="InterchangablePriority_BC" doc:name="InterchangablePriority_BC" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameIP_BC}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.interchangeablePriority.IPController_BC" doc:name="Java"/>
    <logger message="******************Entered IP SOAP File with Province Name BC is Processed from queue*********" level="INFO" category="Audit_LogIP" doc:name="IP Logger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered IP SOAP File with Province Name BC is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogIP" doc:name="IP Exception Logger"/>
    </catch-exception-strategy>
</flow>
<flow name="InterchangablePriority_ON" doc:name="InterchangablePriority_ON" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameIP_ON}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.interchangeablePriority.IPController_ON" doc:name="Java"/>
    <logger message="******************Entered IP SOAP File with Province Name ON is Processed from queue*********" level="INFO" category="Audit_LogIP" doc:name="IP Logger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered IP SOAP File with Province Name ON is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogIP" doc:name="IP Exception Logger"/>
    </catch-exception-strategy>
</flow>
<flow name="InterchangablePriority_MB" doc:name="InterchangablePriority_MB" processingStrategy="allowOneThread">
    <wmq:inbound-endpoint queue="${wmq.queue.nameIP_MB}" connector-ref="WMQ" doc:name="WMQ"/>
    <object-to-string-transformer doc:name="File Mapping"/>
    <custom-transformer class="com.tcs.sdm.kcm.interchangeablePriority.IPController_MB" doc:name="Java"/>
    <logger message="******************Entered IP SOAP File with Province Name MB is Processed from queue*********" level="INFO" category="Audit_LogIP" doc:name="IPLogger"/>
    <catch-exception-strategy doc:name="Catch Exception Strategy">
        <logger message="*******************************Entered IP SOAP File with Province Name MB is having error: #[exception.causeException]****************" level="INFO" category="Audit_LogIP" doc:name="IP Exception Logger"/>
    </catch-exception-strategy>
</flow>

推荐答案

使用流的"initialState"属性.

Use 'initialState' attribute of flow.

<flow name="InterchangablePriority_MB" initialState="stopped">
...
</flow>

此属性的默认值为initialstate ="started".

Default value for this attribute is initialstate="started".

这篇关于如果一个项目中有多个流,则会出现子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆