Troubleshooting: "Check length prefix" error from service MQ rules
Symptom
Service MQ Rules allow external systems to access your application data using the WebSphere MQ middleware messaging standard.
At runtime, an MQ listener, linked to a service MQ rule, waits and listens for incoming messages on a specified WebSphere MQ queue. You can configure MQ Listener to access text from an external system and place it in a clipboard property as follows:
- Create an MQ Service rule.
- Create an MQ Listener rule.
- Place the desired text in the queue.
When you run this configuration, the following error may appear in the log file:
com.pega.pegarules.pub.PRRuntimeException: Attempting to read string from MQ > 1M in length. Check length prefix on string data.
This error is caused by an incorrect setting in the Data Type field on the Request tab of the Connect MQ rule form:
Solution
To resolve this issue, select All Chars
from the Data Type drop-down menu and save the updated rule. This allows Process Commander to read the text in the queue as ASCII characters and manages the data correctly:
After making the rule change, stop and re-start any MQ Listeners that were running when you made the change.