gmoney
gmoney

Reputation: 163

Why do I encounter "inputstream payload cant be distributed" due to ObjectStoreException when deploying the following mule flow?

I get the following exception in my mule flow log:

ERROR 12/09/13 22:33:18 (rg.mule.module.logging.DispatchingLogger:341 ) <org.mule.exception.DefaultMessagingExceptionStrategy>
********************************************************************************
Message               : InputStream payload can't be distributed in a cluster
Type                  : org.mule.api.store.ObjectStoreException
Code                  : MULE_ERROR--2
JavaDoc               : mulesoft.org/docs/site/current3/apidocs/org/mule/api/store/ObjectStoreException.html
********************************************************************************
Exception stack is:
1. InputStream payload can't be distributed in a cluster (org.mule.api.store.ObjectStoreException)
  com.mulesoft.mule.cluster.hazelcast.HazecastQueueObjectStoreAdapter:52 
********************************************************************************
Root Exception stack trace:
org.mule.api.store.ObjectStoreException: InputStream payload can't be distributed in a cluster
        at com.mulesoft.mule.cluster.hazelcast.HazecastQueueObjectStoreAdapter.validatePayloadType(HazecastQueueObjectStoreAdapter.java:52)
        at com.mulesoft.mule.cluster.hazelcast.HazecastQueueObjectStoreAdapter.store(HazecastQueueObjectStoreAdapter.java:34)....
********************************************************************************

And my mule flow is:

<flow name="hawkeye-mule-heartbeat-history-reapingFlow" doc:name="hawkeye-mule-heartbeat-history-reapingFlow">
    <poll frequency="${hb.historical.polling.interval}" doc:name="Poll">
        <http:outbound-endpoint exchange-pattern="request-response" host="${hb.rest.host}" port="${hb.rest.port}" 
            path="${hb.rest.baseURI}/history?expiry=${hb.historical.expiry}" method="DELETE" doc:name="HTTP" mimeType="application/json"/>
    </poll>
    <byte-array-to-string-transformer doc:name="Byte Array to String"/>
    <logger message="hawkeye.mule.heartbeat.history.reaping HTTP Request: ${hb.rest.protocol}://${hb.rest.host}:${hb.rest.port}${hb.rest.baseURI}/history?expiry=${hb.historical.expiry}" 
        level="DEBUG" category="heartbeatReaping" doc:name="HTTP Request logger"/>
    <logger message="hawkeye.mule.heartbeat.history.reaping reaped heartbeats" level="INFO" category="heartbeatReaping" doc:name="Log Heartbeat Reaper" />
</flow>

I was logging the message payload and response code, and that is the goal, but removed this to try and eliminate the exception to no avail. This mule flow runs locally without issue in mule studio but when its deployed on our cluster I get the above exception. Mule docs were not very helpful. Any advice would be appreciated.

Upvotes: 4

Views: 318

Answers (2)

gmoney
gmoney

Reputation: 163

The reason the ObjectStoreException was being thrown was because I needed to explicitly tell mule the processing strategy was synchronous by adding the attribute processingStrategy="synchronous" to the flow element.

It is still unclear however, why I need to explicitly tell mule this flow processing strategy is synchronous. The documentation mule provides leads me to believe mule chooses the correct strategy if none are provided.

Upvotes: 1

David Dossot
David Dossot

Reputation: 33413

This happens because in cluster mode, Mule serializes message payloads and share them across the cluster right within the flow's message source. In your case, the source is the poll element.

This said, the failure looks like a bug: this should work gracefully. As a workaround, could you try serializing to byte[] right in the poller?

<poll frequency="${hb.historical.polling.interval}">
    <http:outbound-endpoint exchange-pattern="request-response" host="${hb.rest.host}" port="${hb.rest.port}" 
        path="${hb.rest.baseURI}/history?expiry=${hb.historical.expiry}"
        method="DELETE" mimeType="application/json">
       <response>
         <byte-array-to-string-transformer />
       </response>
    </http:outbound-endpoint>
</poll>

But since you're using EE, the best is to contact MuleSoft support: it's maybe an already fixed bug. They'll let you know, provide a patch, etc...

Upvotes: 0

Related Questions