Reputation: 1503
I'm using very simple flow, where I have tried to set message attribute( for SQS) in flowVars, so that it will be reflected in my SQS Queue. I have used this link https://github.com/mulesoft/sqs-connector/blob/master/src/test/resources/automation-test-flows.xml for references(In the link they referred by using flow vars). But i'm getting the error like
"Could not find a transformer to transform "SimpleDataType{type=java.lang.String,mimeType='*/*'}" to "SimpleDataType{type=java.util.Map, mimeType='*/*'}". (org.mule.api.transformer.TransformerException)"
Pleasse find my config xml
<flow name="sqsFlow1" doc:name="sqsFlow1">
<sqs:receive-messages config-ref="Amazon_SQS" doc:name="Amazon SQS (Streaming)" numberOfMessages="5" visibilityTimeout="11"/>
<set-variable variableName="setMessageAtt" value="[name:"John"]" doc:name="Variable"/>
sqs:send-message config-ref="Amazon_SQS1" doc:name="Amazon SQS" >
<sqs:message-attributes ref="#[flowVars.setMessageAtt]"/>
</sqs:send-message>
</flow>
I understand the value which I try to return as String
, but it is expecting Map
. Is there any way we can change the string vaue in to Map inside flow variable itself ( Via MEL). If not, how we can handle the scenario. I have tried multiple scenario , but it is not working.
Your help is required. Thanks in advance.
Upvotes: 0
Views: 1617
Reputation: 573
In mule you can represent a Map as: #[key1 : value1, key2 : value2, . . .]
For example, with mel:
#[['title':'value','description':'value','status':'404','bit': false]]
is equivalent to
Map<String, Object>
I hope to help;
Upvotes: 1