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
60
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
82
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
76
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
49
Como excluir o conector do facebook Do anyponit
alexteles10
0
73
Baixando conectores que não são nativos
alexteles10
0
64
Editor do Anypoint
alexteles10
0
52
MuleSoft Como fazer um when dentro de um when
alexteles10
0
71
MuleSoft Property configuração
alexteles10
0
63
Other Decks in Education
See All in Education
Liberalism's Last Man and Asia
vyadav
0
150
Dashboards - Lecture 11 - Information Visualisation (4019538FNR)
signer
PRO
1
2.7k
Case Studies - Lecture 12 - Information Visualisation (4019538FNR)
signer
PRO
0
120
生成AIを授業の相棒にするデータサイエンス入門(「デジタル✕探究」イノベーターズフォーラム テクニカルセッション講演資料)
datascientistsociety
PRO
0
280
AI進化史:LLMからAIエージェントへ
mickey_kubo
0
190
共感から、つくる: 変わり続ける自分と、誰かのための創造
micknerd
1
380
Protecting Patrons with Digital Vendors
dsalo
0
190
[2026前期火5] 論理学(京都大学文学部 前期 第2回)「論理的な正しさはどこにあるのか」
yatabe
0
930
Data Processing and Visualisation Frameworks - Lecture 6 - Information Visualisation (4019538FNR)
signer
PRO
1
3.1k
Info Session MSc Computer Science & MSc Applied Informatics
signer
PRO
0
290
AWS Certified Generative AI Developer - Professional Beta 不合格体験記
amarelo_n24
1
320
[2026前期火5] 論理学(京都大学文学部 前期 第3回)「形式言語と四つのキーワード:メタ・構成・意味論・ハーモニー」
yatabe
0
530
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
Scaling GitHub
holman
464
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
320
Thoughts on Productivity
jonyablonski
76
5.2k
A Tale of Four Properties
chriscoyier
163
24k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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