Issue:
With some use-cases the message size exceeds 6 MB and so the nats payload limitation.
The following error is shown and the message is discarded.
[MessageStore.Publisher] NATS Publish Error: Maximum payload size has been exceeded
Reason:
NATS Connect Platform has a limitation of 12 MB payloads to process, which actually means each message cannot exceed 6 MB size because of what below explained:
The file nats-server.conf located in C:\OCCNMOM\Nats have this property:
[...]
[...]
[!] Note that this value has to be considered halved:
NATS platform needs to store for each message both the original payload AND a transformed payload, so basically the total payload size of each received message would be doubled.
For example, if a message sent have a 10 MB payload size, 20 MB will be the total actual payload size that NATS has to process -> limit would exceed in this case as well!
Important Remark:
As per internal analysis, any modification of this property must be avoided;
We DO NOT recommend to increase this OOB limitation on the NATS allowed payload because it will lead to other issues in performances and can lead to corrupting the jetstreams - reason why it has been set to that value.
Possible WA Solution:
The suggested solution should be to keep always the message size under the size limitation explained above.
A possible way to achieve it is to split the message or apply a xslt filter
Xslt filters can also be used at the WebAPI adapter before the message is send to nats:

Notes:
This is planned to be better detailed in the CNMOM documentation as well for the next product releases.
Also note that there is a property on all adapters, "Clear Original Contents". Setting this to true will reduce the size of the message in NATS. Sadly, it is not exposed in the UI.
However, by some performed tests, this does not seem to have such an impact, and it is normally set as true by default when creating new adapters