Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

Using Weave Reader at Runtime May Cause Performance Issues in Mule 4

公開日: Aug 11, 2025
解決策

SYMPTOM

You get the following WARN level log in the API logs:

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. Latency
  2. CPU maxing out at nearly 100% (error: CPU_INTENSIVE)
  3. Application restarts due to JVM running out of memory (error: Terminating due to java.lang.OutOfMemoryError: Java heap space)

CAUSE

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).

 

PRODUCTS AFFECTED

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.


SOLUTION

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

 
読み込み中
Salesforce Help | Article