Image for post
Image for post
Photo by Nick Fewings on Unsplash

DataWeave is the MuleSoft expression language for accessing and transforming data that travels through a Mule app. Transform message component is the dedicated processor which converts input format to required output format using DataWeave language. DataWeave is tightly integrated with the Mule runtime engine, which runs the scripts and expressions in your Mule app. By default, the Transform message component has DataWeave script inline. We can externalize or move this transformation script to a separate dwl file and have XML reference it.

Following are the reasons for externalizing DataWeave script:

  • Reusability: By externalizing DataWeave script, the same script can be…

Image for post
Image for post
Photo by engin akyurt on Unsplash

Table of Contents

  • Introduction to Apache Kafka
  • Software Versions used in this Demo
  • Install Apache Kafka
  • Disabling Hyper-V
  • Necessary changes in extracted Kafka files
  • zookeeper server deployment
  • Kafka server deployment
  • Create a topic
  • Create a producer
  • Create a consumer
  • Create Mulesoft publish flow
  • Create mulesoft consume flow
  • Test the created flows using Postman
  • Some useful Kafka commands

Introduction to Apache Kafka

Apache Kafka is an open-source stream-processing software platform developed by the Apache Software Foundation, written in Scala and Java.

The benefits of Kafka are as following:

  • High-throughput
  • low-latency
  • Horizontally scalable
  • Ensures no data loss
  • Reduces complexity
  • Topic — a category or feed name to which records…


Previous part: Introduction to Processor Level Error Handling in Anypoint Platform(Mule 4) Part-2

A calling flow has an on error continue or propagate scope and a Try scope. Try scope has an on error continue scope. In try scope, the error occurs at processor labeled as E, and subsequent processors are not executed.

Image for post
Image for post

As the flow is executing and the error occurs at the processor E, the error is thrown to the On Error continue scope of Try scope. After the last processor from this error scope is executed, the subsequent processors of Try scope are not executed and the…


Previous part: Introduction to Processor Level Error Handling in Anypoint Platform(Mule 4) Part-1

A calling flow has an on error continue scope and a Try scope. Try scope has an on error propagate scope. In try scope, the error occurs at processor labeled as E, and subsequent processors are not executed.

Image for post
Image for post

As the flow is executing and the error occurs at the processor E, the error is thrown to the On Error Propagate scope of Try scope. After the last processor from this error scope is executed, the subsequent processors of Try scope are not executed and the Mule event…


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-5

Handling Errors at Processor Level

For more fine-grain error handling of elements within a flow, processor level error handling is used. A “Try” scope is used for the same. Any number of processors can be added to a Try scope. The Try scope has its own error handling section to which one or more error scopes can be added.

A calling flow has an on error propagation scope and a Try scope. Try scope also has an on error propagation scope. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-4

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. Child flow has an on error continue scope and calling flow has an on error continue or propagate scope(both will work in the same manner)present in them.

Image for post
Image for post

When an error happens at processor E, the Event is passed to the on…


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-3

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. Child flow has an on error propagate scope and calling flow has an on error continue scope present in them.

Image for post
Image for post

When an error happens at processor E, the Event is passed to the on error propagate scope of child flow. After…


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-2

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. The error is rethrown and the subsequent processors in calling flow also are not executed.

Image for post
Image for post

The source flow and child flow, both have flow level error handlers with an on error propagate scope. When the error occurs at processor E, the…


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-1

In this scenario, there is a flow level error handler with an On error continue scope. As the flow is executing and the error occurs at the event processor labeled E. Because of this processor P and any subsequent processors will never be executed as shown in the exhibit below.

Image for post
Image for post

In this scenario, the Mule event is passed to the first processor of the flow level error handler. after all processors from an on error continue scope is executed, then the error does not gets rethrown and…


Prerequisite for the article: Introduction to Error Handling in Anypoint Studio(Mule 4)

Error handling scenario 2

In this scenario, there is a flow level error handler with an On error propagate scope. As the flow is executing and the error occurs at the event processor labeled E. Because of this processor P and any subsequent processors will never be executed as shown in the exhibit below.

Image for post
Image for post

In this scenario, the Mule event is passed to the first processor of the flow level error handler. after all processors from an on error propagate scope are executed, the error gets rethrown. …

Sanket Kangle

Software Engg, Data enthusiast, IIT KGP alumnus, Expertise in conceptualizing and scaling a business solution based on new-age technologies — AI, Cloud, API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store