1. Start Stop Mule Flow Using Java
We will use the Java Mule Context and Collable
Interface to start and stop the mule flow. We
have control on flow life cycle using mule
context. We can check life cycle of mule flow
and its different state
3. Start Stop Mule Flow Using Java –
Flow Contd…
• Use HTTP Connector to receive request
• VM is used as out bound and also using “<file-
queue-store/>” for payload persistence
• Java component is used to start the flow
• Another flow
“startstoomuleflowusing_javaFlow1” worked as
in-bound VM with initialState="stopped“. So
mule will not start this flow on application
deployment
• We will use java component to start this flow
6. Start Stop Mule Flow Using Java –
Java Contd..
• Using “@Inject”(javax.inject.Inject) Annotation to get
the MuleContext(org.mule.api.MuleContext) Object
• Implements Callable (org.mule.api.lifecycle.Callable)
Interface
• Use MuleContext to get the
Flow(org.mule.construct.Flow) Object
“muleContext.getRegistry().get("startstoomuleflowus
ing_javaFlow1")”
• Use Flow Object to start the flow “flow.start()”
7. Start Stop Mule Flow Using Java –
Java Contd..
• Using “@Inject”(javax.inject.Inject) Annotation to get
the MuleContext(org.mule.api.MuleContext) Object
• Implements Callable (org.mule.api.lifecycle.Callable)
Interface
• Use MuleContext to get the
Flow(org.mule.construct.Flow) Object
“muleContext.getRegistry().get("startstoomuleflowus
ing_javaFlow1")”
• Use Flow Object to start the flow “flow.start()”