SlideShare a Scribd company logo
1 of 36
July 4th 2020 : What’s new in Mule 4.3 and Custom Policy in mule 4
[Thiruvananthapuram –INDIA]
Virtual Meetup #2
All contents © MuleSoft Inc.
Guidelines for Thiruvananthapuram MuleSoft Meetup #01 [Virtual]
2
• Please keep yourself unless you have any questions.
• We encourage you to keep your video on for interactive session.
• You can write down your question in the chat session.
• Once join please write down your name and email id in chat so that we can have attendance.
• Please provide your valuable feedback. Thanks.
All contents © MuleSoft Inc. 3
All contents © MuleSoft Inc.
Agenda
• Introductions
• What’s new in Mule 4.3
• Custom Policy in Mule 4
• Plan for next meetup
• Networking time
All contents © MuleSoft Inc.
Why we are here?
5
• A group of community, by the community.
• A platform to learn and share integration
experiences with like-minded world.
• Discuss a set of important contents relating
to development and deployment with
MuleSoft’s Anypoint Platform.
All contents © MuleSoft Inc.
Introductions
6
• About the organizer:
– Anurag Kumar Dwivedi
• About the Sponsers:
– MuleSoft
All contents © MuleSoft Inc.
Speakers
7
• About the Speakers:
– Lalit Panwar
– Shivam Khandelwal
A SHOW OF HANDS:
Who is new to this MeetUp?
Introduction to MuleSoft
What is new?
In Anypoint Studio
7.5+
All contents © MuleSoft Inc.
Product Version
Mule runtime engine 4.3.0
Apache Maven 3.3.9
DataWeave 2.3.0
Eclipse 4.13
MMP 3.3.9
AdoptOpenJDK JDK 8 (jdk8u232-b09)
Plugins:
MUnit 2.2.5
MUnit Studio Plugin 2.5.0
APIkit 1.3.12
API Editor Plugin 2.3.3
Git Int for Eclipse 5.6.1
What is bundled?
10
All contents © MuleSoft Inc.
Studio 7.5+ improves the collaboration in the API development process and introduces lot of new functionality as under:
● Import API specifications from Design Center standalone as a dependency.
● Edit OAS and RAML API specifications in Studio.
● Use the version control mechanism via EGit to pull, push, and merge changes made to API specifications.
● Compare changes in API specifications with a new diff view.
● Upgrade to Eclipse 4.13.
● AdoptOpenJDK 8 included with Studio.
● Enhanced UI performance with improvements made to garbage collecting mechanisms, minimized background
processes, and lazy UI loading.
● Deployment support for Anypoint Platform Private Cloud Edition (PCE) version 2.1.0.
What is bundled?
11
What is new?
In Mule 4.3+
All contents © MuleSoft Inc.
1. Until Successful Scope
The Until Successful scope processes the components within it, in order, until they succeed or exhaust the maximum number of
retries. Like all Core components other than Async, Until Successful runs synchronously. If a component within the scope fails to
connect or produce a successful result, Until Successful retries the failed task until all configured retries are exhausted. If a retry
succeeds, the scope proceeds to the next component. If the final retry does not succeed, Until Successful produces an error.
Common processes that use Until Successful include:
● Dispatching to outbound endpoints, for example, when calling a remote web service that might have availability issues.
● Executing a component method, for example, when executing on a Spring bean that may depend on unreliable resources.
● Using a sub-flow to re-execute several actions until they all succeed.
Attributes:
A. Max Retries (maxRetries): Specifies the maximum number of retries that are allowed. This attribute can be either a number or
an expression that resolves to a number. An error message looks like this: Message: 'until-successful' retries exhausted. The
Mule error type is MULE:RETRY_EXHAUSTED.
B. Milliseconds Between Retries (millisBetweenRetries)
Specifies, in milliseconds, the minimum interval between two retries. The actual interval depends on the previous execution,
but it should not exceed twice this number. The default value is 60000 milliseconds (one minute). This attribute can be either a
number or an expression that resolves to a number.
Changes in Core Components
13
All contents © MuleSoft Inc.
We have the Payload(input to batch):
[
{
"name":
"Tony Stark",
"alias": "Iron
Man",
"status":
"DEAD"
},
{
"name":
"Steve Rodgers",
"alias":
"Captain America",
"status":
"RETIRED"
},
{
"name":
"Peter Parker",
"alias":
2. Preserving the MIME types of the Aggregated Record
Changes in Core Components
14
We Executed the Batch:
<batch:job name="avengersLogger">
<batch:process-records>
<batch:step name="log">
<batch:aggregator
size="10">
<foreach>
<logger message="Agent #[payload.alias] is
#[payload.status]" />
</foreach>
</batch:aggregator>
</batch:step>
</batch:process-records>
</batch:name>
All contents © MuleSoft Inc.
{
"name": "Tony Stark",
"alias": "Iron Man",
"status": "DEAD"
}
What happened here?
The batch engine splits the
input JSON array into individual
records, which means that the
aggregator block receives an
array with three elements. The
first one of them is:
Changes in Core Components
15
*****************************************************************************
***
Message : "You called the function 'Value Selector' with these
arguments:
1: Binary
("ewogICJmaXJzdE5hbWUiOiAiUmFtIiwKICAibGFzdE5hbWUiOiAiUmFtMSIsCiAgImFkZHJlc3M
i...)
2: Name ("alias")
But it expects one of these combinations:
(Array, Name)
(Array, String)
(Date, Name)
(DateTime, Name)
(LocalDateTime, Name)
(LocalTime, Name)
(Object, Name)
(Object, String)
(Period, Name)
(Time, Name)
5| name: payload.alias,
^^^^^^^^^^^^^
All contents © MuleSoft Inc.
Policies applied to outgoing HTTP requests are known as outbound policies. You implement them by
defining an http-policy:operation block in the policy template, specifying the execution components.
Mule runtime engine then applies the operation block of every policy that is applied to an API to every HTTP
requester element defined in a Mule application. Now if you have a particular request component where you wants
to ignore outbound policies, then that can be done like below:
Changes in Outbound HttpRequests
16
<flow name="implementation">
<http:listener config-ref="http-config" path="api"/>
<http:request method="GET" url="http://service-1" />
<logger message="#[payload]" level="INFO"/>
<http:request method="POST" url="http://service-2" api-
gateway:disablePolicies="true" />
</flow>
All contents © MuleSoft Inc.
Literal Types in Dataweave
17
A literal type represents exactly one value. For example, the String value "foo" can be represented with the type
"foo".
The following literal types are included to the type system:
● String literal types
● Number literal types
● Boolean literal types
You can use literal types with Union types to declare a type as a finite set of allowed values. For example, the
following type declarations are aliases of Union and literal types:
type Weekdays = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday"
type Days = Weekdays | "Saturday" | "Sunday"
All contents © MuleSoft Inc.
Intersection Type in Dataweave
18
Mule 4.3 introduces the Intersection type in the DataWeave. The Intersection type appends Object types.
The Intersection type intersects Object types. In this case, the intersection works as the concatenation (++) of object
types.
The syntax for the Intersection type is:
○ TypeA & TypeB & …
In the following example, the Intersection concatenates the two Object types, resulting in the type {name: String,
lastName: String}. The type is an open object that can accept additional key-value pairs. The variable accepts the value
assigned to it:
○ var a: {name: String} & {lastName: String} = {name: "John", lastName: "Smith", age: 34}
In the case of closed objects, it returns the concatenation of the object types but results in a closed object.
In the following example, the intersection results in the type {|name: String, lastName: String|}, which throws an
exception because a closed object does not accept an Object value if there are additional fields in the object (field age):
○ var a: {|name: String|} & {|lastName: String|} = {name: "John", lastName: "Smith", age: 34}
All contents © MuleSoft Inc.
New DataWeave Reader and Writer Properties
19
DataWeave introduces a number of new and enhanced reader and writer properties for supported DataWeave
formats.
○ Binary (application/octet-stream) format: encoding
○ DataWeave (application/dw) format: onlyData writer property and all the reader properties
(externalResources, javaModule, and onlyData)
○ JSON (application/json) format: writeAttributes
○ XML (application/xml) format: escapeCR writer property and several reader properties (collectionPath,
maxAttributeSize, optimizeFor, supportDtd, streaming)
○ YAML (application/yaml) format: maxEntityCount reader property
All contents © MuleSoft Inc.
Updates in DataWeave Modules
20
DataWeave also introduces a number of new functions in existing modules:
1. Core (dw::Core) module: entriesOf, keysOf, namesOf, valuesOf.
2. Arrays (dw::core::Arrays) module: firstWith
3. Objects (dw::core::Objects) module: everyEntry, someEntry, and takeWhile; dropWhile also
includes a new function that iterates over and ignores items in an array until a condition becomes
true.
4. Strings (dw::core::Strings) module: withMaxSize enables you to specify a maximum size for a given
value. A value that exceeds the size limit will be truncated. If the size is no greater than the limit, the
value remains the same.
Deprecations:
The entrySet, keySet, nameSet, valueSet functions in the Objects module are deprecated in this
release and replaced with the functions entriesOf, keysOf, namesOf, valuesOf in the Core module.
All contents © MuleSoft Inc.
It provides lot of functions relating to operations of data types.
These functions are: ()
arrayItem baseTypeOf
functionParamTypes
functionReturnType intersectionItems isAnyType
isArrayType isBinaryType
isBooleanType
isDateTimeType isDateType
isFunctionType
isIntersectionType isKeyType isLiteralType
isLocalDateTimeType isLocalTimeType isNamespaceType
isNothingType isNullType
isNumberType
isObjectType isPeriodType isRangeType
isReferenceType isRegexType isStringType
isTimeType isTimeZoneType isTypeType
Types Module added in DataWeave
21
All contents © MuleSoft Inc.
Source:
%dw 2.0
output application/json
var period = (|2010-12-10T12:10:12| - |2010-12-10T10:02:10|)
---
{
hours: period.hours,
minutes: period.minutes,
secs: period.secs,
}
Period and DateTime Consistency
22
Output:
{
"hours": 2,
"minutes": 8,
"secs": 2
}
All contents © MuleSoft Inc.
[
{
"ID" : 4128506,
"name": "Ken",
"age": 30
},
{
"ID" : 1823940,
"name": "Tomo",
"age": 70
},
{
"ID": 9086582,
"name": "Kajika",
"age": 10
}
]
Update(function) in DataWeave
23
Script:
%dw 2.0
output application/json
---
payload map ((user) ->
user update {
case name at .name if(name == "Tomo") ->
name ++ " (Christian)"
case age at .age -> age + 1
}
)
[
{
"ID": 4128506,
"name": "Ken",
"age": 31
},
{
"ID": 1823940,
"name": "Tomo (Christian)",
"age": 71
},
{
"ID": 9086582,
"name": "Kajika",
"age": 11
}
]
All contents © MuleSoft Inc.
Now, in Mule 4.3+, the DataWeave improves the performance of memory usage, functions (like groupBy), and the internal
execution engine in this release. Now it will not execute the the script as it is. Now it will optimize the script by removing
common subexpressions that are repeated, then the optimized code will be executed finally by the Mule Runtime. i.e.
Performance Improvements in DataWeave
24
Script we used:
%dw 2.0
output application/json
---
{
code: payload.message.code,
message : payload.message.value,
user :
payload.message.users[0].name,
contact:
payload.message.users[0].email
}
Internal representation:
%dw 2.0
output application/json
var fakeVariable1 = payload.message
var fakeVariable2 = fakeVariable1.users[0]
---
{
code: fakeVariable1.code,
message : fakeVariable1.value,
user : fakeVariable2.name,
contact: fakeVariable2.email
}
All contents © MuleSoft Inc.
Q&A
All contents © MuleSoft Inc.
Custom Policy in Mule 4
Shivam Khandelwal
All contents © MuleSoft Inc.
Agenda
● What is Policy?
● What is custom policy?
● How to implement Custom Policy in Mule 4
● Implementation of Custom Policy
● Demo with use case
● Q&A
All contents © MuleSoft Inc.
What is Policy?
● Policies enable you to enforce regulations to help manage security, control
traffic, and improve adaptability of your APIs. For example, a policy can
control authentication, access, allotted consumption, and service level
access (SLA).
● You can implement all these regulations with no modification to the code
implementation. Mulesoft provides ready-to-use default policies that are
shipped with the product. Additionally, you can create custom policies
based on your specific business requirements.
All contents © MuleSoft Inc.
Custom Policy
Custom Policies are policies that anyone can develop and apply to their APIs,
with the intention of extending existing functionality or defining new ones.
The current workflow to get a working policy for Mule 4 that can be applied in
Anypoint Platform consists of:
1. Develop the policy.
2. Package the policy.
3. Upload the resulting policy assets to Exchange.
4. Apply the policy to any API through API Manager.
All contents © MuleSoft Inc.
Covid Flight Booking Use case
All contents © MuleSoft Inc.
Q&A
All contents © MuleSoft Inc.
What’s next
32
• Share:
– Tweet your pictures with the hashtag #MuleMeetup
– Invite your network to join: https://meetups.mulesoft.com/Thiruvananthapuram/
• Feedback:
– Contact your organizer Anurag Dwivedi to suggest topics
– Contact MuleSoft at meetup@mulesoft.com for ways to improve the program
• Our next meetup:
– Date: TBD
– Location: TBD
– Topic: TBD
All contents © MuleSoft Inc.
Take a stand !
Introduce yourself to neighbours
Networking time
34
See you next time
Please send topic suggestions to the organizer
Mulesoftmeetup4th july

More Related Content

What's hot

web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh MalothBhavsingh Maloth
 
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...Impetus Technologies
 
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...TelecomValley
 
Apache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationApache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationPiyush Goel
 
WSO2 ESB Introduction to Inbound Endpoints
WSO2 ESB Introduction to Inbound EndpointsWSO2 ESB Introduction to Inbound Endpoints
WSO2 ESB Introduction to Inbound EndpointsIsuru Udana
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningArul ChristhuRaj Alphonse
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questionstechievarsity
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Peter R. Egli
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theoryMukesh Tekwani
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogXavier Hausherr
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDIShahid Shaik
 

What's hot (20)

web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
 
Java Programming - 07 java networking
Java Programming - 07 java networkingJava Programming - 07 java networking
Java Programming - 07 java networking
 
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
 
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...
SophiaConf2010 Présentation des Retours d'expériences de la Conférence du 08 ...
 
Apache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationApache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language Communication
 
WSO2 ESB Introduction to Inbound Endpoints
WSO2 ESB Introduction to Inbound EndpointsWSO2 ESB Introduction to Inbound Endpoints
WSO2 ESB Introduction to Inbound Endpoints
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questions
 
Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theory
 
java networking
 java networking java networking
java networking
 
Spring integration
Spring integrationSpring integration
Spring integration
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ Overblog
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
 
Building Web Services
Building Web ServicesBuilding Web Services
Building Web Services
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Java networking
Java networkingJava networking
Java networking
 

Similar to Mulesoftmeetup4th july

MuleSoft Manchester Meetup #3 slides 31st March 2020
MuleSoft Manchester Meetup #3 slides 31st March 2020MuleSoft Manchester Meetup #3 slides 31st March 2020
MuleSoft Manchester Meetup #3 slides 31st March 2020Ieva Navickaite
 
Mulesoft meetup 9thmay Thiruvananthapuram
Mulesoft meetup 9thmay ThiruvananthapuramMulesoft meetup 9thmay Thiruvananthapuram
Mulesoft meetup 9thmay ThiruvananthapuramAnurag Dwivedi
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019Subhash Patel
 
MuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesMuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesSubhash Patel
 
Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup Rajesh Maheshwari
 
West Yorkshire Mulesoft Meetup #6
West Yorkshire Mulesoft Meetup #6West Yorkshire Mulesoft Meetup #6
West Yorkshire Mulesoft Meetup #6Francis Edwards
 
Mule soft Meetup #3
 Mule soft Meetup #3 Mule soft Meetup #3
Mule soft Meetup #3Gaurav Sethi
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP APIThiago Santana
 
MuleSoft Meetup Mumbai Mule 4 Presentation Slide
MuleSoft Meetup Mumbai Mule 4 Presentation SlideMuleSoft Meetup Mumbai Mule 4 Presentation Slide
MuleSoft Meetup Mumbai Mule 4 Presentation SlideManish Kumar Yadav
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysAngel Alberici
 
Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Tejas Purohit
 
MuleSoft Clustring, Okta, CI/CD Integration with Jenkins
MuleSoft Clustring, Okta, CI/CD Integration with JenkinsMuleSoft Clustring, Okta, CI/CD Integration with Jenkins
MuleSoft Clustring, Okta, CI/CD Integration with JenkinsManish Kumar Yadav
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceIRJET Journal
 
JMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialJMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialRyan Baxter
 
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocialIBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocialIBM Connections Developers
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsTechieVarsity
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 

Similar to Mulesoftmeetup4th july (20)

MuleSoft Manchester Meetup #3 slides 31st March 2020
MuleSoft Manchester Meetup #3 slides 31st March 2020MuleSoft Manchester Meetup #3 slides 31st March 2020
MuleSoft Manchester Meetup #3 slides 31st March 2020
 
Mulesoft meetup 9thmay Thiruvananthapuram
Mulesoft meetup 9thmay ThiruvananthapuramMulesoft meetup 9thmay Thiruvananthapuram
Mulesoft meetup 9thmay Thiruvananthapuram
 
Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
 
MuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesMuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation Slides
 
Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup
 
West Yorkshire Mulesoft Meetup #6
West Yorkshire Mulesoft Meetup #6West Yorkshire Mulesoft Meetup #6
West Yorkshire Mulesoft Meetup #6
 
Mule soft Meetup #3
 Mule soft Meetup #3 Mule soft Meetup #3
Mule soft Meetup #3
 
File Upload with RESP API
File Upload with RESP APIFile Upload with RESP API
File Upload with RESP API
 
MuleSoft Meetup Mumbai Mule 4 Presentation Slide
MuleSoft Meetup Mumbai Mule 4 Presentation SlideMuleSoft Meetup Mumbai Mule 4 Presentation Slide
MuleSoft Meetup Mumbai Mule 4 Presentation Slide
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
 
Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4
 
MuleSoft Clustring, Okta, CI/CD Integration with Jenkins
MuleSoft Clustring, Okta, CI/CD Integration with JenkinsMuleSoft Clustring, Okta, CI/CD Integration with Jenkins
MuleSoft Clustring, Okta, CI/CD Integration with Jenkins
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-Service
 
JMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocialJMP103 : Extending Your App Arsenal With OpenSocial
JMP103 : Extending Your App Arsenal With OpenSocial
 
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocialIBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
IBM Connect 2014 - JMP103: Extending Your Application Arsenal With OpenSocial
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Data Base Connector
Data Base Connector Data Base Connector
Data Base Connector
 

More from Anurag Dwivedi

Anypoint_Code_Builder_-Toronto Meetup.pptx
Anypoint_Code_Builder_-Toronto Meetup.pptxAnypoint_Code_Builder_-Toronto Meetup.pptx
Anypoint_Code_Builder_-Toronto Meetup.pptxAnurag Dwivedi
 
Toronto Anypoint DataGraph (1).pptx
Toronto Anypoint DataGraph (1).pptxToronto Anypoint DataGraph (1).pptx
Toronto Anypoint DataGraph (1).pptxAnurag Dwivedi
 
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptx
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptxToronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptx
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptxAnurag Dwivedi
 
Mulesoft torronto meetup_16
Mulesoft torronto meetup_16Mulesoft torronto meetup_16
Mulesoft torronto meetup_16Anurag Dwivedi
 
Toronto mule soft meetup november 2021
Toronto mule soft meetup   november 2021Toronto mule soft meetup   november 2021
Toronto mule soft meetup november 2021Anurag Dwivedi
 
Mulesoftmeetup20th mar final
Mulesoftmeetup20th mar finalMulesoftmeetup20th mar final
Mulesoftmeetup20th mar finalAnurag Dwivedi
 
Mulesoftmeetup Thiruvanathapuram #4
Mulesoftmeetup Thiruvanathapuram #4Mulesoftmeetup Thiruvanathapuram #4
Mulesoftmeetup Thiruvanathapuram #4Anurag Dwivedi
 

More from Anurag Dwivedi (7)

Anypoint_Code_Builder_-Toronto Meetup.pptx
Anypoint_Code_Builder_-Toronto Meetup.pptxAnypoint_Code_Builder_-Toronto Meetup.pptx
Anypoint_Code_Builder_-Toronto Meetup.pptx
 
Toronto Anypoint DataGraph (1).pptx
Toronto Anypoint DataGraph (1).pptxToronto Anypoint DataGraph (1).pptx
Toronto Anypoint DataGraph (1).pptx
 
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptx
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptxToronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptx
Toronto MuleSoft_Meetup_Run Time Fabric - Self Managed Kubernetes.pptx
 
Mulesoft torronto meetup_16
Mulesoft torronto meetup_16Mulesoft torronto meetup_16
Mulesoft torronto meetup_16
 
Toronto mule soft meetup november 2021
Toronto mule soft meetup   november 2021Toronto mule soft meetup   november 2021
Toronto mule soft meetup november 2021
 
Mulesoftmeetup20th mar final
Mulesoftmeetup20th mar finalMulesoftmeetup20th mar final
Mulesoftmeetup20th mar final
 
Mulesoftmeetup Thiruvanathapuram #4
Mulesoftmeetup Thiruvanathapuram #4Mulesoftmeetup Thiruvanathapuram #4
Mulesoftmeetup Thiruvanathapuram #4
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

Mulesoftmeetup4th july

  • 1. July 4th 2020 : What’s new in Mule 4.3 and Custom Policy in mule 4 [Thiruvananthapuram –INDIA] Virtual Meetup #2
  • 2. All contents © MuleSoft Inc. Guidelines for Thiruvananthapuram MuleSoft Meetup #01 [Virtual] 2 • Please keep yourself unless you have any questions. • We encourage you to keep your video on for interactive session. • You can write down your question in the chat session. • Once join please write down your name and email id in chat so that we can have attendance. • Please provide your valuable feedback. Thanks.
  • 3. All contents © MuleSoft Inc. 3
  • 4. All contents © MuleSoft Inc. Agenda • Introductions • What’s new in Mule 4.3 • Custom Policy in Mule 4 • Plan for next meetup • Networking time
  • 5. All contents © MuleSoft Inc. Why we are here? 5 • A group of community, by the community. • A platform to learn and share integration experiences with like-minded world. • Discuss a set of important contents relating to development and deployment with MuleSoft’s Anypoint Platform.
  • 6. All contents © MuleSoft Inc. Introductions 6 • About the organizer: – Anurag Kumar Dwivedi • About the Sponsers: – MuleSoft
  • 7. All contents © MuleSoft Inc. Speakers 7 • About the Speakers: – Lalit Panwar – Shivam Khandelwal A SHOW OF HANDS: Who is new to this MeetUp?
  • 9. What is new? In Anypoint Studio 7.5+
  • 10. All contents © MuleSoft Inc. Product Version Mule runtime engine 4.3.0 Apache Maven 3.3.9 DataWeave 2.3.0 Eclipse 4.13 MMP 3.3.9 AdoptOpenJDK JDK 8 (jdk8u232-b09) Plugins: MUnit 2.2.5 MUnit Studio Plugin 2.5.0 APIkit 1.3.12 API Editor Plugin 2.3.3 Git Int for Eclipse 5.6.1 What is bundled? 10
  • 11. All contents © MuleSoft Inc. Studio 7.5+ improves the collaboration in the API development process and introduces lot of new functionality as under: ● Import API specifications from Design Center standalone as a dependency. ● Edit OAS and RAML API specifications in Studio. ● Use the version control mechanism via EGit to pull, push, and merge changes made to API specifications. ● Compare changes in API specifications with a new diff view. ● Upgrade to Eclipse 4.13. ● AdoptOpenJDK 8 included with Studio. ● Enhanced UI performance with improvements made to garbage collecting mechanisms, minimized background processes, and lazy UI loading. ● Deployment support for Anypoint Platform Private Cloud Edition (PCE) version 2.1.0. What is bundled? 11
  • 12. What is new? In Mule 4.3+
  • 13. All contents © MuleSoft Inc. 1. Until Successful Scope The Until Successful scope processes the components within it, in order, until they succeed or exhaust the maximum number of retries. Like all Core components other than Async, Until Successful runs synchronously. If a component within the scope fails to connect or produce a successful result, Until Successful retries the failed task until all configured retries are exhausted. If a retry succeeds, the scope proceeds to the next component. If the final retry does not succeed, Until Successful produces an error. Common processes that use Until Successful include: ● Dispatching to outbound endpoints, for example, when calling a remote web service that might have availability issues. ● Executing a component method, for example, when executing on a Spring bean that may depend on unreliable resources. ● Using a sub-flow to re-execute several actions until they all succeed. Attributes: A. Max Retries (maxRetries): Specifies the maximum number of retries that are allowed. This attribute can be either a number or an expression that resolves to a number. An error message looks like this: Message: 'until-successful' retries exhausted. The Mule error type is MULE:RETRY_EXHAUSTED. B. Milliseconds Between Retries (millisBetweenRetries) Specifies, in milliseconds, the minimum interval between two retries. The actual interval depends on the previous execution, but it should not exceed twice this number. The default value is 60000 milliseconds (one minute). This attribute can be either a number or an expression that resolves to a number. Changes in Core Components 13
  • 14. All contents © MuleSoft Inc. We have the Payload(input to batch): [ { "name": "Tony Stark", "alias": "Iron Man", "status": "DEAD" }, { "name": "Steve Rodgers", "alias": "Captain America", "status": "RETIRED" }, { "name": "Peter Parker", "alias": 2. Preserving the MIME types of the Aggregated Record Changes in Core Components 14 We Executed the Batch: <batch:job name="avengersLogger"> <batch:process-records> <batch:step name="log"> <batch:aggregator size="10"> <foreach> <logger message="Agent #[payload.alias] is #[payload.status]" /> </foreach> </batch:aggregator> </batch:step> </batch:process-records> </batch:name>
  • 15. All contents © MuleSoft Inc. { "name": "Tony Stark", "alias": "Iron Man", "status": "DEAD" } What happened here? The batch engine splits the input JSON array into individual records, which means that the aggregator block receives an array with three elements. The first one of them is: Changes in Core Components 15 ***************************************************************************** *** Message : "You called the function 'Value Selector' with these arguments: 1: Binary ("ewogICJmaXJzdE5hbWUiOiAiUmFtIiwKICAibGFzdE5hbWUiOiAiUmFtMSIsCiAgImFkZHJlc3M i...) 2: Name ("alias") But it expects one of these combinations: (Array, Name) (Array, String) (Date, Name) (DateTime, Name) (LocalDateTime, Name) (LocalTime, Name) (Object, Name) (Object, String) (Period, Name) (Time, Name) 5| name: payload.alias, ^^^^^^^^^^^^^
  • 16. All contents © MuleSoft Inc. Policies applied to outgoing HTTP requests are known as outbound policies. You implement them by defining an http-policy:operation block in the policy template, specifying the execution components. Mule runtime engine then applies the operation block of every policy that is applied to an API to every HTTP requester element defined in a Mule application. Now if you have a particular request component where you wants to ignore outbound policies, then that can be done like below: Changes in Outbound HttpRequests 16 <flow name="implementation"> <http:listener config-ref="http-config" path="api"/> <http:request method="GET" url="http://service-1" /> <logger message="#[payload]" level="INFO"/> <http:request method="POST" url="http://service-2" api- gateway:disablePolicies="true" /> </flow>
  • 17. All contents © MuleSoft Inc. Literal Types in Dataweave 17 A literal type represents exactly one value. For example, the String value "foo" can be represented with the type "foo". The following literal types are included to the type system: ● String literal types ● Number literal types ● Boolean literal types You can use literal types with Union types to declare a type as a finite set of allowed values. For example, the following type declarations are aliases of Union and literal types: type Weekdays = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" type Days = Weekdays | "Saturday" | "Sunday"
  • 18. All contents © MuleSoft Inc. Intersection Type in Dataweave 18 Mule 4.3 introduces the Intersection type in the DataWeave. The Intersection type appends Object types. The Intersection type intersects Object types. In this case, the intersection works as the concatenation (++) of object types. The syntax for the Intersection type is: ○ TypeA & TypeB & … In the following example, the Intersection concatenates the two Object types, resulting in the type {name: String, lastName: String}. The type is an open object that can accept additional key-value pairs. The variable accepts the value assigned to it: ○ var a: {name: String} & {lastName: String} = {name: "John", lastName: "Smith", age: 34} In the case of closed objects, it returns the concatenation of the object types but results in a closed object. In the following example, the intersection results in the type {|name: String, lastName: String|}, which throws an exception because a closed object does not accept an Object value if there are additional fields in the object (field age): ○ var a: {|name: String|} & {|lastName: String|} = {name: "John", lastName: "Smith", age: 34}
  • 19. All contents © MuleSoft Inc. New DataWeave Reader and Writer Properties 19 DataWeave introduces a number of new and enhanced reader and writer properties for supported DataWeave formats. ○ Binary (application/octet-stream) format: encoding ○ DataWeave (application/dw) format: onlyData writer property and all the reader properties (externalResources, javaModule, and onlyData) ○ JSON (application/json) format: writeAttributes ○ XML (application/xml) format: escapeCR writer property and several reader properties (collectionPath, maxAttributeSize, optimizeFor, supportDtd, streaming) ○ YAML (application/yaml) format: maxEntityCount reader property
  • 20. All contents © MuleSoft Inc. Updates in DataWeave Modules 20 DataWeave also introduces a number of new functions in existing modules: 1. Core (dw::Core) module: entriesOf, keysOf, namesOf, valuesOf. 2. Arrays (dw::core::Arrays) module: firstWith 3. Objects (dw::core::Objects) module: everyEntry, someEntry, and takeWhile; dropWhile also includes a new function that iterates over and ignores items in an array until a condition becomes true. 4. Strings (dw::core::Strings) module: withMaxSize enables you to specify a maximum size for a given value. A value that exceeds the size limit will be truncated. If the size is no greater than the limit, the value remains the same. Deprecations: The entrySet, keySet, nameSet, valueSet functions in the Objects module are deprecated in this release and replaced with the functions entriesOf, keysOf, namesOf, valuesOf in the Core module.
  • 21. All contents © MuleSoft Inc. It provides lot of functions relating to operations of data types. These functions are: () arrayItem baseTypeOf functionParamTypes functionReturnType intersectionItems isAnyType isArrayType isBinaryType isBooleanType isDateTimeType isDateType isFunctionType isIntersectionType isKeyType isLiteralType isLocalDateTimeType isLocalTimeType isNamespaceType isNothingType isNullType isNumberType isObjectType isPeriodType isRangeType isReferenceType isRegexType isStringType isTimeType isTimeZoneType isTypeType Types Module added in DataWeave 21
  • 22. All contents © MuleSoft Inc. Source: %dw 2.0 output application/json var period = (|2010-12-10T12:10:12| - |2010-12-10T10:02:10|) --- { hours: period.hours, minutes: period.minutes, secs: period.secs, } Period and DateTime Consistency 22 Output: { "hours": 2, "minutes": 8, "secs": 2 }
  • 23. All contents © MuleSoft Inc. [ { "ID" : 4128506, "name": "Ken", "age": 30 }, { "ID" : 1823940, "name": "Tomo", "age": 70 }, { "ID": 9086582, "name": "Kajika", "age": 10 } ] Update(function) in DataWeave 23 Script: %dw 2.0 output application/json --- payload map ((user) -> user update { case name at .name if(name == "Tomo") -> name ++ " (Christian)" case age at .age -> age + 1 } ) [ { "ID": 4128506, "name": "Ken", "age": 31 }, { "ID": 1823940, "name": "Tomo (Christian)", "age": 71 }, { "ID": 9086582, "name": "Kajika", "age": 11 } ]
  • 24. All contents © MuleSoft Inc. Now, in Mule 4.3+, the DataWeave improves the performance of memory usage, functions (like groupBy), and the internal execution engine in this release. Now it will not execute the the script as it is. Now it will optimize the script by removing common subexpressions that are repeated, then the optimized code will be executed finally by the Mule Runtime. i.e. Performance Improvements in DataWeave 24 Script we used: %dw 2.0 output application/json --- { code: payload.message.code, message : payload.message.value, user : payload.message.users[0].name, contact: payload.message.users[0].email } Internal representation: %dw 2.0 output application/json var fakeVariable1 = payload.message var fakeVariable2 = fakeVariable1.users[0] --- { code: fakeVariable1.code, message : fakeVariable1.value, user : fakeVariable2.name, contact: fakeVariable2.email }
  • 25. All contents © MuleSoft Inc. Q&A
  • 26. All contents © MuleSoft Inc. Custom Policy in Mule 4 Shivam Khandelwal
  • 27. All contents © MuleSoft Inc. Agenda ● What is Policy? ● What is custom policy? ● How to implement Custom Policy in Mule 4 ● Implementation of Custom Policy ● Demo with use case ● Q&A
  • 28. All contents © MuleSoft Inc. What is Policy? ● Policies enable you to enforce regulations to help manage security, control traffic, and improve adaptability of your APIs. For example, a policy can control authentication, access, allotted consumption, and service level access (SLA). ● You can implement all these regulations with no modification to the code implementation. Mulesoft provides ready-to-use default policies that are shipped with the product. Additionally, you can create custom policies based on your specific business requirements.
  • 29. All contents © MuleSoft Inc. Custom Policy Custom Policies are policies that anyone can develop and apply to their APIs, with the intention of extending existing functionality or defining new ones. The current workflow to get a working policy for Mule 4 that can be applied in Anypoint Platform consists of: 1. Develop the policy. 2. Package the policy. 3. Upload the resulting policy assets to Exchange. 4. Apply the policy to any API through API Manager.
  • 30. All contents © MuleSoft Inc. Covid Flight Booking Use case
  • 31. All contents © MuleSoft Inc. Q&A
  • 32. All contents © MuleSoft Inc. What’s next 32 • Share: – Tweet your pictures with the hashtag #MuleMeetup – Invite your network to join: https://meetups.mulesoft.com/Thiruvananthapuram/ • Feedback: – Contact your organizer Anurag Dwivedi to suggest topics – Contact MuleSoft at meetup@mulesoft.com for ways to improve the program • Our next meetup: – Date: TBD – Location: TBD – Topic: TBD
  • 33. All contents © MuleSoft Inc. Take a stand !
  • 34. Introduce yourself to neighbours Networking time 34
  • 35. See you next time Please send topic suggestions to the organizer