0
votes

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.

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.

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.

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>

1
I think that you need to post your xml config with everything you've describedsecario
I attached the XML in the Question itselfuser3675877

1 Answers

0
votes

Use 'initialState' attribute of flow.

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

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