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
120
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
79
Baixando conectores que não são nativos
alexteles10
0
68
Editor do Anypoint
alexteles10
0
56
MuleSoft Como fazer um when dentro de um when
alexteles10
0
74
MuleSoft Property configuração
alexteles10
0
65
Other Decks in Education
See All in Education
良書紹介08_ 頭のいい子がやっているすごいグラフの読み方
bunnchinn3
0
160
Course Review - Lecture 13 - Information Visualisation (4019538FNR)
signer
PRO
1
2.8k
学習者データを「見る」:外国語教師のためのデータの入力、分析、解釈方法
uranoken
0
300
The Strengthening Institutions Program
territorium
PRO
0
160
AI時代のセキュリティ監査
matshogo
PRO
0
100
Throw Yourself In! - How I've learned English and What I'm Facing
georgeorge
1
260
Course Review - Lecture 13 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
2.4k
0526
cbtlibrary
0
270
「答えを出す」より「わかる」をつくる
kzkmaeda
1
290
データマネジメント試験対策教材1〜データマネジメント基礎〜
yoshimura_datam
1
710
Lectura 1 (PIT : Python Basico)
robintux
0
1.1k
Réunion des directrices et directeurs des écoles de la circonscription de Jonzac - 31 août 2026
fmarot
0
110
Featured
See All Featured
It's Worth the Effort
3n
188
29k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
How STYLIGHT went responsive
nonsquared
100
6.3k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
430
Designing for Performance
lara
611
70k
Unsuck your backbone
ammeep
672
58k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
500
Into the Great Unknown - MozCon
thekraken
41
2.7k
Rails Girls Zürich Keynote
gr2m
96
14k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
The Language of Interfaces
destraynor
162
27k
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