Articles

Dataweave Interview Question Using Map and Reduce

This article will help you practice your Dataweave skills in Mulesoft. Here we have to convert the input to a specific type of output. Let’s get started.

Input:

Source de l’article sur DZONE

Implementing DDoS With MuleSoft: Demonstration With Apache JMeter


DDoS (Distributed Denial Of Service)

A Distributed Denial-of-Service (DDoS) is any type of attack where the attackers attempt to prevent legitimate users from accessing the service. In a DDoS attack, the attacker usually sends excessive messages asking the network or server to authenticate requests that have invalid return addresses.

How to Prevent DDoS Attacks

There are different ways we can prevent DDoS attacks; we can do IP blacklisting to avoid traffic from sources of attack, rate limit your application to prevent it from being overwhelmed, or use both of them to provide multiple layers of security.

Source de l’article sur DZONE

Implement a Counter in Dataweave 2.x and Above

Implement a Counter in Dataweave

These days, I see quite a few posts that require using Counter in DataWeave. The problem faced is that users require a Sequence Number that is consistent throughout the different sections of data. Consider the below JSON:

JSON

xxxxxxxxxx
1

17

 

1

[{

2

"Item" : "ItemXYZ",

3

  "SequenceNo" : 1,

4

  "Parts": [

5

{ "Part" : "A1", "SequenceNo" : 2 }, { "Part" : "B1", "SequenceNo" : 3 },

6

{ "Part" : "A2", "SequenceNo" : 4 }, { "Part" : "B2", "SequenceNo" : 5 }

7

 ]

8

},

9

 {

10

"Item" : "ItemRTY",

11

  "SequenceNo" : 6,

12

  "Parts": [

13

{ "Part" : "A1", "SequenceNo" : 7 }, { "Part" : "B1", "SequenceNo" : 8 },

14

{ "Part" : "A2", "SequenceNo" : 9 }, { "Part" : "B2", "SequenceNo" : 10 }

15

 ]

16

}

17

]

Source de l’article sur DZONE

MuleSoft 4: Invoke REST API


Problem Statement

Recently, while working with MuleSoft 4 (AnyPoint Platform – 7.3.1), I had come across a scenario that requires invocation of another REST API, which is also implemented on MuleSoft. This API requires input in the form of URI parameters. This API works well when invoked from an external client like Postman, however, exceptions are observed when the same API is invoked from MuleSoft.

Implementation Details

App – Currency Conversation is implemented for providing currency conversion details in real-time , this APP can be invoked by URL  -http://<<hostname>> /api/ currenyconversion /baseCcy /<<value>> /targetCcy/<<value>>

Source de l’article sur DZONE