Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
50
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
92
Chamando um flow de dentro do Transform Message
alexteles10
0
74
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
69
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
42
Como excluir o conector do facebook Do anyponit
alexteles10
0
67
Baixando conectores que não são nativos
alexteles10
0
58
Editor do Anypoint
alexteles10
0
45
MuleSoft Como fazer um when dentro de um when
alexteles10
0
46
MuleSoft Property configuração
alexteles10
0
58
Other Decks in Education
See All in Education
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.4k
1008
cbtlibrary
0
100
Entrepreneurship minor course at HSE 2025
karlov
0
140
Software
irocho
0
630
DIP_3_Frequency
hachama
0
310
ROSConJP 2025 発表スライド
f0reacharr
0
260
SISTEMA DE MEMORIA Y SU IMPACTO EN LAS DECISIONES.
jvpcubias
0
190
QR-koodit opetuksessa
matleenalaakso
0
1.7k
20250830_本社にみんなの公園を作ってみた
yoneyan
0
160
Padlet opetuksessa
matleenalaakso
9
15k
Web Architectures - Lecture 2 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
GOVERNOR ADDRESS:2025年9月29日合同公式訪問例会:2720 Japan O.K. ロータリーEクラブ、2025年10月6日卓話:藤田 千克由 氏(国際ロータリー第2720地区 2025-2026年度 ガバナー・大分中央ロータリークラブ・大分トキハタクシー(株)顧問)
2720japanoke
0
700
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Scaling GitHub
holman
464
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Become a Pro
speakerdeck
PRO
30
5.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Git: the NoSQL Database
bkeepers
PRO
432
66k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
990
RailsConf 2023
tenderlove
30
1.3k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
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