Apache Camel - Marshal and Unmarshal JSON

  Рет қаралды 7,534

Djole

Djole

Күн бұрын

Hello KZbin!
As i promised in previous video, today we are gonna talk about marshal (serialization) and unmarshal (deserialization) of the JSON payload which we got from the fakerapi. We used Jackson library to transform data.
Camel in Action book: amzn.to/3Figv3s
Buy me a coffee here. :)
www.buymeacoff...
If you like this, please support me by subscribing and commenting what would you like to see next.
Github repo: github.com/djo...
Twitter: / djordje_the_dev
Last year i wrote eBook, it's a story how I managed to get into software development. It also has some tips how to improve your scheduling and productivity.
Purchase link: www.amazon.com...
Take care,
Djordje / George

Пікірлер
@m3kbeatz
@m3kbeatz 3 жыл бұрын
Do u have any example of aggregation of two different rest calls responses in sequence? Hvala
@georgedoestechstuff7012
@georgedoestechstuff7012 3 жыл бұрын
Do you really need aggregation for that? I would use loop or split and save responses from each iteration in exchange property, you can deserialize and modify each response as you wish and do not have to worry about aggregation strategy. Can you give me an argument why you want to use aggregation? Nema na cemu, - Djordje
@m3kbeatz
@m3kbeatz 3 жыл бұрын
@@georgedoestechstuff7012 just started to learn apache camel and any solution for that would be awesome.
@m3kbeatz
@m3kbeatz 3 жыл бұрын
@@georgedoestechstuff7012 in my business logic i have two rest calls to different endpoints. Second rest call needs some data from first call and then I need to return data from first and second call back to client.
@georgedoestechstuff7012
@georgedoestechstuff7012 3 жыл бұрын
@@m3kbeatz here is an example, you modify it per your use-case. ... .setProperty("Responses").constant(some type you need) .setBody(constant(here set list of urls)) .split().body() .toD("${body}") .unmarshal(here use some JacksonDataFormat with response model) .process(exchange ->{ CustomModel model =exchange.getIn().getBody(CustomModel.class); //Update exchange property with response we extracted from body }) .end() This is typed from my phone so sorry for typos. This is just a basic logic, you would need to do a little more by yourself. -Djordje
@m3kbeatz
@m3kbeatz 3 жыл бұрын
@@georgedoestechstuff7012 hvala. Pozz
@ramonmoraga1316
@ramonmoraga1316 2 жыл бұрын
alguien puede ayudarme.Me da error : Unrecognized field "status" (class com.lespinel.primerproyecto.Addresses), not marked as ignorable (0 known properties: ])
@ananthukkumar987
@ananthukkumar987 10 ай бұрын
How did the Address model got data?
@georgedoestechstuff7012
@georgedoestechstuff7012 10 ай бұрын
I used fakerapi to mock that response as you can see in the actual camel route. Go to the website: fakerapi.it/en, create your mock and use it to marshal/unmarshal data. Thanks for watching, Cheers!
@metaverse1518
@metaverse1518 2 жыл бұрын
General suggestion: Don't use dark mode. and small fonts.
@ramonmoraga1316
@ramonmoraga1316 2 жыл бұрын
alguien puede ayudarme con el error:(Unrecognized field "code" (class com.lespinel.primerproyecto.Addresses), not marked as ignorable (2 known properties: "status", "requestId"]))
How to handle Errors and Exceptions in Apache Camel ?
17:59
Apache Camel - Create a route
9:43
Djole
Рет қаралды 6 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Adding JSON to my REST API in Apache Camel [Code-along]
13:37
Tom D - Tutorial Works
Рет қаралды 8 М.
Kafka on Kubernetes: Secured with TLS
27:28
CONFIG LEARNING HUB
Рет қаралды 28
Apache Camel Bean Validation
5:46
Djole
Рет қаралды 1,8 М.
Apache Camel-Marshal/Unmarshal XML/JSON Data Example
10:11
JavaInUse
Рет қаралды 18 М.
Tooling guide for Getting Started with Apache Camel in 2021
11:51
Christina Lin
Рет қаралды 7 М.
What is Apache Camel?
4:40
Tom D - Tutorial Works
Рет қаралды 79 М.
Apache Camel + Spring Boot REST API  | Example | Java Techie
24:29
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН