4

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.

gmoney
  • 143
  • 7

2 Answers2

1

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.

gmoney
  • 143
  • 7
0

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

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • Thanks for the advice. I tried what you have recommended but mule complains: Invalid content was found starting with element 'byte-array-to-string-transformer'. No child element is expected at this point. I was able to add the byte[] transformer-ref to the http endpoint but that has not solved my issue either. The flow works, the HTTP request is sent and it behaves properly but I can't log anything, I just get the ObjectStoreException. I will attempt to contact mule support and see what they have to say. – gmoney Dec 09 '13 at 23:35
  • OK. In the meantime could you try with the `` wrapper where I added it in my answer? – David Dossot Dec 09 '13 at 23:53
  • Alright, your original suggestion was fine, I forgot to leave the outbound endpoint tag open. Unfortunately, this did not prevent the above exception from occurring. I think I have solved this one though, will provide an answer below. Thanks a lot for your help! – gmoney Dec 10 '13 at 00:10
  • Anyway, I'll be curious to know if the `` wrapper has any effect, if you have a chance to try it. – David Dossot Dec 10 '13 at 00:30
  • David, I did try the response wrapper and I was able to use that within the poller, however this did not prevent the ObjectStoreException I was encountering. I to had add attribute **processingStrategy="synchronous"** to the flow element to get the flow to behave properly. – gmoney Dec 10 '13 at 00:41
  • 1
    Roger that. Thanks for the extra info. I guess by forcing the processing strategy to synchronous, you're pinning the execution to a single node, which disables forced cluster serialization? Ah, doesn't it show I'm not a Mule cluster expert? :) Call MuleSoft :) – David Dossot Dec 10 '13 at 00:56