
Mule CRC32 Processor
When to Use CRC32
Mule can apply a cyclic redundancy check (CRC) to messages to ensure integrity. The CRC32 processor acts as an enricher to generate a checksum to a message when it enters a system, then act as a filter to verify the checksum when the message leaves the system. If the entry and exit values do not match, CRC terminates the message’s processing.
The CRC32 processor allows the user to verify that a message remains intact between a sender and a receiver. Because it does not itself provide encryption or append a signature to the message, you can use it in conjunction with other security features to provide an additional level of confidence in the authenticity of a message.
Generating a Checksum
This topic introduces the idea of Global Elements; if you are unfamiliar with this functionality, access Understand Global Mule Elements to learn more before proceeding. |
To use the CRC32 processor to generate a checksum on a message, you must, at minimum, configure two elements in your Mule application:
-
a global CRC32 element
-
a CRC32 processor
Completing these steps ensures that Mule calculates a checksum based on your payload and enriches the properties of your Mule message with that checksum.
Creating a Global Element
-
Create and configure the global element through the Global Element tab at the bottom of the canvas, or directly within the CRC32 building block’s Properties pane by clicking the
icon to the right of the Connector Ref field.
-
In the Global Element Properties pane, enter a meaningful Name for the global element.
-
In the Target Expression field, accept the default variable name. See image below for example.

Or, configure the global element in the XML editor, as shown below:
<crc32:config name="Global_CRC32_Calculation" targetExpression="#[variable:crc32]/>
Configuring a CRC32 Message Processor
-
Insert a CRC32 processor in your Mule flow.
-
In the Pattern Properties pane, enter a Display Name.
-
Reference the global CRC32 element that you just created by clicking the
icon next to the Config Reference field.
-
Set the Operation field to
Calculate
.

By default, Mule calculates based on the entire payload. Use the Input Reference field to specify a different target for the calculation, if necessary. |
Or, configure the CRC32 building block in the XML editor, as shown below:
<crc32:calculate config-ref="Global_CRC32_Calculation" doc:name="CRC Calculation"/>
Verifying a Checksum
To use the CRC32 processor to verify a checksum on a message, you must, at minimum, configure two elements in your Mule application:
-
a CRC32 message processor
-
a CRC32 global element
Completing these steps ensure that Mule verifies the checksum in the properties of your message by comparing it against the checksum you calculated in the CRC32 calculation, Generating a Checksum.
Configuring a CRC32 Message Processor
-
First, insert a CRC32 processor into your Mule flow, positioned at the point where you would like to verify the checksum.
-
Double-click the message processor to open the Pattern Properties pane, then enter a Display Name.
-
Set the Operation field to
CRC Filter
. -
Enter the Expected Checksum, matching the contents of the Target Expression field in the CRC32 global element in your configuration of the CRC32 calculation.
Or, configure the CRC32 building block in the XML editor, as shown below:
<crc32:filter config-ref="CRC32" expectedChecksum="#[variable:crc32]" doc:name="CRC32 Filter"/>