Using Weave Reader at Runtime May Cause Performance Issues. It is strongly advice to either use with `onlyData=true` or try other MimeType. This format was design for debugging and design only.
There are three likely scenarios when the above WARN will be thrown:
1. The API contains a DataWeave transformation using "application/dw" output like this:
%dw 2.0 output application/dw --- payload
2. You are using a "readUrl" DW function like the below to read an external DWL file, with and without input payload:
output application/json
---
readUrl('classpath://testprojectFlowtest1/set-event_payload.dwl')
3. You are using a "read" DW function like the below:
%dw 2.0
output application/json
---
{
"test": read('{ "hello" : "world" }')
}
Examples of performance issues
1. The API contains a DataWeave transformation using "application/dw" output like the below. This output format, also known as "Weave Reader" is not meant for production environments, so it will have a performance impact.
%dw 2.0 output application/dw --- payload
2. If "{onlyData: true}" is not included at the end of "readUrl" DW function like below then performance WARN logs will continue to be thrown.
output application/json
---
readUrl('classpath://testprojectFlowtest1/set-event_payload.dwl')
3. This is mostly the same as for readUrl function (see "2" above).
The performance impact is present in any Mule 4 version if you use the "application/dw" output.
But the WARN level log was first introduced in Mule 4.4 runtime.
In 4.4 runtime onwards, based on the two scenarios:
1. Add "onlyData=true" property to use a production-compatible weave reader and avoid having the performance impact to DW script like below.
%dw 2.0 output application/dw onlyData=true --- payload
2. Add ""application/dw",{onlyData: true}" to the end of the "readUrl" function like below:
output application/json
---
readUrl('classpath://testprojectFlowtest1/set-event_payload.dwl', "application/dw",{onlyData: true})
3. Similar to the readUrl, for the read function you should also add ""application/dw",{onlyData: true}" to the end of the function like below:
output application/json
---
{
"test": read('{ "hello" : "world" }', "application/dw",{onlyData: true})
}
NOTE:
1. As alternative solution, instead of adding the '"application/dw",{onlyData: true}', you can use a different format for your output, like 'text/plain' (depending on your use case it might work or not).
2. If you are using an older runtime version then you should avoid using application/dw output format as reader property onlyData is not supported there. Thus, the performance impact could be even more severe.
3. Only include "application/dw" in ""application/dw",{onlyData: true}" if you are reading a payload otherwise just add "{onlyData: true}" i.e. when reading a library.
More info in our official DataWeave documentation: DataWeave (dw) Format - Reader Properties
001122386

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.