Mulesoft xml filewatcher7/7/2023 We can set a payload through XML configuration code − It’s also optional but represents the encoding of the value that is assigned to the payload of message. It’s optional but represents the mime type of the value assigned to the payload of message. It will accept a literal string or DataWeave expression defining how to set the payload. The value filed is required for setting a payload. The table below shows the name of fields and their description to be considered while configuring set payload transformer − Field It can be used for simple ones like selections. It is not recommended to use this component for complex expressions or transformations. With the help of set-payload component, we can update the payload, which can be a literal string or DataWeave expression, of the message. It represents the name of the variable to remove. We can customize this to display a unique name for this component in our Mule working flow. The table below shows the name of fields and their description to be considered while configuring removing variable transformer − Sr.No Configuring removing variable transformer Transformer components are of the following types − Remove variable transformerĪs the name implies, this component takes a variable name and removes that variable from the Mule event. Suppose if we want to set or remove a part of any Mule event, Transformer component is the best choice. If the error is successfully handled by try scope, then the route will be able to generate a Mule event, for sure. To handle this error type, a try scope can be used in each route of Scatter-Gather component. This error will be thrown by the S-G component only after every route either fails or completes. Any error might be generated within event processors leading the Scatter-Gather component to throw an error of type Mule: COMPOSITE_ERROR. Error Handling by Scatter-Gather Routerįirst, we must have knowledge on the kind of error that can be generated within Scatter-Gather component. It executes every route in parallel and not sequentially. Schematic Diagram of Scatter-Gather Routerįollowing is the schematic diagram of a Scatter-Gather Router having four event processors. Here the condition is that the S-G router will pass a consolidated Mule event to the next event processor only when every route is completed successfully. After this, it passes this consolidated Mule event to the next event processor. Next, this router gathers the created Mule events from each route and then consolidates them together into a new Mule event. Every Mule event will have its own payload, attributes as well as variables. Each route in this case will create a Mule event by using a separate thread. The condition is that each route must be a sequence of one or more event processors which is like a sub-flow. We can understand its working with the help of following two points −įirst, this router copies (Scatter) a Mule event to two or more parallel routes. As its name implies, it works on the fundamentals of scatters (copy) and Gather (Consolidates). Scatter-Gather RouterĪnother most used routing event processor is Scatter-Gather component. Following is the schematic diagram of a Choice Router, having three options. The effect of using Choice router is just like adding conditional processing to a flow or an if/then/else code block in most of the programming languages. We can define choice routers as the router that dynamically routes message through a flow according to a set of DataWeave expressions used to evaluate message content. As discussed earlier, each route is a separate sequence of Mule event processors. Choice RouterĪs the name suggests, this router applies DataWeave logic to choose one of two or more routes. Choice and Scatter-Gather routers are the most used routers under Flow Control component. It is basically routing the input Mule event to other sequence(s) of components. The main task of Flow Control component is to take the input Mule event and route it to one or more separate sequences of components.
0 Comments
Leave a Reply. |