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
64
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MuleSoft mock com set payload
MuleSoft mock com set payload
Alex teles
January 09, 2017
More Decks by Alex teles
See All by Alex teles
Mulesoft configurando conexão com banco AS400 DB2
alexteles10
0
110
Chamando um flow de dentro do Transform Message
alexteles10
0
85
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
82
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
52
Como excluir o conector do facebook Do anyponit
alexteles10
0
78
Baixando conectores que não são nativos
alexteles10
0
65
Editor do Anypoint
alexteles10
0
53
MuleSoft Como fazer um when dentro de um when
alexteles10
0
73
MuleSoft Property configuração
alexteles10
0
65
Other Decks in Education
See All in Education
解決策を教えても次期リーダーは育たない ─ 器の発達に伴走するために / Partnering with leaders in their vertical development
matsu0228
1
620
良書紹介08_ 頭のいい子がやっているすごいグラフの読み方
bunnchinn3
0
140
!コスパよくインターンに受かる方法!
ruribou
1
320
【デザイナー就活講座】 デザイナー就活市場・企業探し・ポートフォリオのポイント
koheihasebe
0
420
Geografía y fútbol. Atlanta. la megalópolis del fútbol
juanmartin2026
1
12k
NDIAS Automotive / IoT CTF 2026 Recap - Keyfob & OSINT
himitu23
0
300
AIがコードを書く時代に、何を教えるのか / What Should We Teach in the Age of AI-Generated Code?
ichiroc
1
470
エビデンスベースト英語教育入門:エビデンスは科学的知見(だけ)ではない,制度だ!
terasawat
0
140
人間のために、人間と共に働く時代の終わりの始まり
frievea
0
110
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
220
AI-Based Speaking Assessment of a Short-Term Study Abroad Program
uranoken
0
430
プロポーザルを書く技術とアンチパターン/proposal-writing-and-antipatterns
moriyuya
13
3.7k
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.8k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
920
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Discover your Explorer Soul
emna__ayadi
2
1.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
200
30 Presentation Tips
portentint
PRO
1
370
4 Signs Your Business is Dying
shpigford
187
23k
Odyssey Design
rkendrick25
PRO
2
760
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