Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MuleSoft mock com set payload
Search
Alex teles
January 09, 2017
Education
0
45
MuleSoft mock com set payload
MuleSoft mock com set payload
Alex teles
January 09, 2017
Tweet
Share
More Decks by Alex teles
See All by Alex teles
Mulesoft configurando conexão com banco AS400 DB2
alexteles10
0
88
Chamando um flow de dentro do Transform Message
alexteles10
0
71
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
67
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
40
Como excluir o conector do facebook Do anyponit
alexteles10
0
66
Baixando conectores que não são nativos
alexteles10
0
57
Editor do Anypoint
alexteles10
0
41
MuleSoft Como fazer um when dentro de um when
alexteles10
0
45
MuleSoft Property configuração
alexteles10
0
56
Other Decks in Education
See All in Education
生成AIとの上手な付き合い方【公開版】/ How to Get Along Well with Generative AI (Public Version)
handlename
0
560
新卒研修に仕掛ける 学びのサイクル / Implementing Learning Cycles in New Graduate Training
takashi_toyosaki
1
200
大学院進学について(2025年度版)
imash
0
110
Sponsor the Conference | VizChitra 2025
vizchitra
0
600
Data Physicalisation - Lecture 9 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
470
モンテカルロ法(3) 発展的アルゴリズム / Simulation 04
kaityo256
PRO
7
1.4k
2025年度春学期 統計学 第14回 分布についての仮説を検証する ー 仮説検定(1) (2025. 7. 10)
akiraasano
PRO
0
130
OJTに夢を見すぎていませんか? ロールプレイ研修の試行錯誤/tryanderror-in-roleplaying-training
takipone
1
200
Constructing a Custom TeX Ecosystem for Educational Institutions—Beyond Academic Typesetting
doratex
1
16k
AI for Learning
fonylew
0
180
技術勉強会 〜 OAuth & OIDC 入門編 / 20250528 OAuth and OIDC
oidfj
5
1.6k
American Airlines® USA Contact Numbers: The Ultimate 2025 Guide
lievliev
0
240
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Thoughts on Productivity
jonyablonski
69
4.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
Embracing the Ebb and Flow
colly
86
4.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Producing Creativity
orderedlist
PRO
347
40k
Balancing Empowerment & Direction
lara
1
540
Optimising Largest Contentful Paint
csswizardry
37
3.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Transcript
MuleSoft 2017
Hoje vamos falar de mock dados usando o Set
payload
Vamos criar um fluxo com da seguinte forma (Poll, set
Payload, Transform Message, log)
Mude a execução do Poll para minutos para não executa
a cada um segundo
Nosso transform espera receber uma lista de json com (Nome,
Descricao e Valor) então preciso passa essa estrutura com valores para testar.
Estrutura json [ { "Nome":"pao", "Descricao":"pao de queijo", "Valor":"1"
}, { "Nome":"queijo", "Descricao":"queijo coalho", "Valor":"2" } ]
No Set Payload no quadro value você tem que preenche
com o json semelhante com a esperada
Json setado no set payload e type MIME e Encoging
Rodando o projeto em modo Debug com break no Set
payload Payload vázio
Depois do set Payload o valor do set payload foi
atribuído ao payload
Resultado depois do transform uma lista conforme a saída setado
no transform
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring- beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd"> <flow name="mock-set-payloadFlow"> <poll doc:name="Poll"> <fixed-frequency-scheduler frequency="1000" timeUnit="MINUTES"/> <logger message="====Start=====" level="INFO" doc:name="Logger"/> </poll> <set-payload value="[ { "Nome":"pao", "Descricao":"pao de queijo", "Valor":"1" },
{ "Nome":"queijo", "Descricao":"queijo coalho", "Valor":"2"
} ]" encoding="UTF-8" mimeType="application/json" doc:name="Set Payload"/> <dw:transform-message metadata:id="a1c6eb81-1b6a-4655-b17f-2ee3d5afb0e0" doc:name="Transform Message"> <dw:input-payload doc:sample="input.json" mimeType="application/json"/> <dw:set-payload><![CDATA[%dw 1.0 %output application/java --- payload map ((payload01 , indexOfPayload01) -> { name: payload01.Nome, description: payload01.Descricao, value: payload01.Valor })]]></dw:set-payload> </dw:transform-message> <logger message="=====resultado======#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/> </flow> </mule>
FIM