Mulesoft - SCOPES
Scopes are nothing but the processing blocks. Scopes like poll,Message enricher, until successful require to embed only one message processor within processing block.
Composite Source:
The processor inside Composite source are actually message sources, known as inbound connectors which listens parallel on different channels for incoming messages.
Synchronous means: Processing in main flow stops and all Message processors in child flow execute before parent flow resumes.
Asynchronous means: Parent flow doesn’t wait for child flow to complete.
Async Scope:
In Async Scope , when parent flow receives a message, it sends a copy of message onto the next message processor in parent flow , while simultaneously processing another copy of messagethrough its own.
Sub-flow Scope:
It is a synchronous flow. After receiving message from aren’t flow through flow-ref, the child flow go through message processors contain in it and then further parent flow continues.
Cache Scope:
It caches data produced by part of that particular flow. Wrap Cache scope around message processors in your flow, so it caches the response events produced within flow.
ForEach :
Splits any type of message collection and then aggregates them again at the end of scope.
· You cannot drag inbound-connector inside for loop .
· If you drag a two-way connector into foreach loop , mule automatically converts it into outbound-only connector
Message Enricher:
Appends information to a message , often expression is used to tell what part of payload to evaluate , so to return appropriate value to append to payload.
e.g.: The expression can evaluate pincode and then append associated state and city to payload
Poll:
Polling is used to trigger the connector, placed in it at regular intervals or the time set using cron expression.
Transactional:
Series of steps in flow must succeed or fail as one unit. Place something inside Transactional component and the output will always be either success or failure.
Until Successful:
Attempts at a specified interval, to route a message to an embedded message processor until one of the following occurs:
· Message processor succeeds.
· Maximum number of retries reached .
· An exception is thrown.
Request-Reply Scope:
Request-reply scope enables us to embedded a part of async processing within Muleflow. Simply, request-reply converts part of synchronous process into asynchronous one.
Request : Outbound connector that submits an async request to another flow or external resource.
Reply: Inbound connector that receives an async response from another flow or external source
Batch-Processing :
A block of code is splitted (messages) into individual records , performs action on each record and report the result and pushes the processed output to other systems or queues .
Useful for streaming input jobs.
**Needs enterprise edition.
Batch-Commit :
Batch commit scope is used inside batch-scope .
Eg: To upsert contact numbers to google contacts.
If we are inserting each individual contact, we can configure batch commit to accumulate , say 100 contacts per commit as one chunk.
Batch- Scope:
Use as many as you can, inside processing section of main batch scope.
Processor-chain:
It is a linear chain of message processors which process in order.