MuleSoft_Misc Flashcards
(46 cards)
Where are dataweave functions packaged in Mule?
Mule functions are packaged in Modules
What are the default functions that are imported in DataWeave scripts?
Functions in the core modules are imported automatically in Mule
What are the alternative solutions that can be used for functions with 2 parameters?
#[contains(payload, MAX)] #[payload contains "MAX"]
What is alternative syntax for the following expression?
sizeOf(filter(payload, (value) -> value.age > 30))
sizeOf(payload filter $.age > 30)
How is the following sequence of functions are executed?
flights orderBy $.price filter ($.availableSeats > 30 )
The last function in the chain is executed first filter and followed by orderBy.
Which function is used for removing duplicate data?
distinctBy
Which function is used to filter records?
Filter
Which function is used to order records on the basis of a key?
orderBy
How to add dash in place of space or any other parameter?
using dasherize function
How to call flows from a dataweave expression?
{a: lookup(‘myFlow’, {b: ‘Hello’})}
Inside lookup function first parameter is the flow name and the second parameter is the payload we want to send to the flow.
In Mule 4, All connectors are operation based and not transport based?
True
How Mule 4 connectors are more flexible?
- File connectors can read anywhere in the flow.
- Database connectors can query anywhere in the flow.
- JMS connector can consume anywhere in the flow.
How do we synchronize data from one system to another?
In data synchronization, initially we need to synchronize the initial payload and subsequent times we need to synchronize only new data.
How do we determine which data need to be synced up and when?
In the first sync store the timestamp and in the subsequent times check if the timestamp is greater than the previous timestamp.
What is a timestamp?
The timestamp is often a:-
1- Creation Timestamp
2- Modification Timestamp
3- Record ID
What are the types of watermarking in Mule?
There are 2 types of watermarking in Mule:-
- Automatic
- Manual
Watermarking option is available for which operations?
Automatic watermarking operation is available for the New and Updated file operation for the family of file connectors.
Watermark can be used to ensure if a file is new? What are the other options that can be used to ensure if a file is new?
Delete, move, filter
How does the db query looks like when we enable watermarking?
SELECT * FROM table WHERE TIMESTAMP > :watermark
How does watermark behaves?
On each poll the component will go through all the retrieved rows and store the maximum value obtained.
Handling idempotency across concurrent requests?
A new poll can be executed before the watermark is updated if
- The poll interval is small
- The amounts of rows is big
- Processing one single row takes too much time.
In order to handle the idempotency and avoid reprocessing of single record multiple times what should we use?
Specify an ID column make sure the row is not processed again if:-
- processing of it has already been done.
- or the processing of record is underway.
What are steps involved in manual watermarking?
The general process is:-
- Schedule when a flow should be executed.
- Give the watermark default value.
- on the first sync
- Determine a new watermark value
- store the watermark value so it is available in the future for other flows.
- on the later sync
- Retrieve the watermark from storage.
- Check if each item in the data set should be retrieved based on watermark value.
What are types of scheduling strategies?
- Fixed Frequency
- CRON Job