Professional Documents
Culture Documents
Su Kumar
Su Kumar
5. I want to validate one of the fields in my RAML, that is email id. How do you validate
email id field in RAML?
Basically, we will do all kind of validations using DATA TYPES fragment. For email id
field validation, we can define PATTERN keyword. In PATTERN keyword we can
define it should accept only one ‘@’ symbol and only one ‘.’ symbol.
6. What is the use of DATA TYPES in RAML?
Data Types is one type of fragment. It is used to validate the incoming payload by writing
JSON schemas inside the data types file.
Data types can describe a base or resource URI parameter, a query parameter, a request or response header, or a request or
response body. Data types are built-in or custom. A built-in type can be used anywhere the API expects data.
7. What is mule event?
Mule event is combination of payload, attributes and variables.
8. What is the difference between SOAP & REST services?
SOAP is heavy in weight but REST is light weight service.
SOAP will accept only XML data, REST will accept all kinds of data formats like JSON, XML,
CSV.
9. How do you secure your API’s?
In our project we have applied the policies in API manager to secure the API’s. And
also, we can use HTTPS protocol for our APIs for more security. When we apply
HTTPS protocol, we need to define the TLS configuration in our HTTP connector.
We will be provided with KEY STORE and TRUST STORE details with the mapping
sheet. So, we will configure KEY STORE in our HTTP listener and TRUST STORE in or
HTTP REQUEST connector.
10. I have a company employee’s data with multiple locations like Hyderabad, Chennai
and Pune in a SFTP server. Now, I want to read the file from SFTP and generate
separate file for every location? How you will design a flow for this?
First, I will use SFTP read connector to read the data from the file, after I get the file I
will use SCATTER GATHER component.
Inside SCATTER GATHER, I will create separate flows or routes for every location. As
we have 3 locations here, I will create 3 routes inside SCATTER GATHER. In first route
of SCATTER GATHER, we can use transform message to filter only HYDERABAD
employee’s data.
In the 2nd route of SCATTER GATHER, we can use one more transform message to
filter only CHENNAI employee’s data. Like this we can design solution for this
requirement.
11. Can I place only one route inside SCATTER GATHER component?
No, it will throw an error. We should keep minimum of 2 routes in SCATTER GATHER.
12. I have deployed one simple application with 0.1 vCore in cloudhub. But, I would like
to process 1GB data with this application. So, can I process 1GB data with 0.1 vCore ?
In 0.1 vCore we get 500 MB of memory and 8GB of worker storage space.
By using File store streaming strategy, we can process 1GB file with 0.1 vCore.
Because in file store streaming, only some amount of data will be stored in memory
and rest of the data will be stored in worker’s storage space. So, it will split the data
and processed internally.
File store streaming is a default streaming strategy in mule 4.
13. How many streaming strategies are available in mule 4?
We have 3 types of streaming strategies:
o Repeatable File Store Streaming
▪ Default
▪ Data is stored in Memory and Storage
▪ Non-Consumable Payloads
▪ Can be configured for Performance
▪ Reliable
o Repeatable In Memory Streaming
▪ Data is stored only in Memory
▪ If it reaches to maximum memory, we will get memory issues.
▪ It is faster processing
o Non-Repeatable Streaming
▪ Data is stored in Memory
▪ Payload will become null after a single use by a processor
▪ Improves TPS and Performance as it releases the memory
14. In which ports you will deploy the applications in Cloud Hub?
In my project, we will deploy the applications using 8081, 8082, 8091, 8092 ports.
Usually, we will deploy our experience api’s with 8081 or 8082 ports. If it is HTTP, we will
use 8081 & if its HTTPS we will use 8082 port.
We will deploy our process, system api’s with 8091 or 8092 ports. If HTTP – 8091, HTTPS-
8092 port.
In my application 8091 & 8092 are private ports. Whenever we deploy the application in
private ports, nobody from outside can consume our api’s.
This is how we will deploy the applications in Cloudhub.
15. I am getting an error while sending a request to one of the REST service, how you
will implement RETRY mechanism?
We can use UNTIL SUCCESSFUL scope to implement the RETRY mechanism. Here we
have to wrap the HTTP REQUEST component inside the UNTIL SUCCESSFUL scope. So it
will do the retry as per configuration.
16. What is the difference between FOR EACH & PARALLEL FOR EACH?
For each is used for sequential processing of the data.
Parallel for each is used to do the parallel processing.
Only one thread will execute in case of FOR EACH.
Multiple threads will run in parallel in case of PARALLEL FOR EACH.
17. What are the differences between parallel for each and Batch?
• Parallel For-Each is Synchronous and Batch is Asynchronous
• Predefined sections in Batch for Handling Errors, Processing, Aggregation, On
Complete
• Can customize Number of Threads based on incoming Records and Batch
Block Size
• The batch does not give any output payload. Parallel For Each provides the
output of Processed Records in the same order
18. What are the different types of THREADS available in MULE 4?
We mainly have 3 types of threads in MULE 4:
CPU LITE – this thread will be invoked with connectors which can execute in less
than 10 seconds. Example: SET VARIABLE.
CPU INTESIVE – connectors with above 10 seconds processing time, will be used.
Example – TRANSFORMATION message component
BLOCKING IO – is for transactions and batch processing.
19. Have you ever worked with Transaction Management or Transactions in Mule 4?
No. I never used TRANSACTIONS in my project but I have knowledge on this.
There are 2 types of transactions. in Mule 4:
➢ Single transactions,
➢ extended transactions
Transactions are used to roll back the data.
Transactions will be used with Database, VM, JMS connectors
How you will initiate transaction?
We can initiate transaction using try scope or any event source connector
21. What is the dynamic and parameterized query in the DB connector, how to execute
and how to execute the stored procedure in mule?
We used parameterized queries in DB operations to avoid SQL injection. Dynamic
queries lead to SQL injections. SQL injections are the vulnerable thing and used to
attack data-driven applications and to hack database applications. We can call store
procedure from database connector in Mule
22. How to encrypt and use secure properties?
1. Create a property files containing the properties you want to secure
2. Pass the property file to the Secure Properties Tool
3. Provide the Mule application with a secure properties configuration
4. Add the Secure Configuration Properties module to the application
5. Use the secure properties in your application
6. Hide properties from view in Runtime Manager
24. What is the Errortype Reflected when one of the flows in scatter-gather throws
error?
After every route executes. If any has failed with an error. Then the scatter-gather
components throws error of tyoe: MULE:COMPOSITE:ROUTING
25. Where and how should the value global error handler be added in the Mule project
so that the error handler scope is the default error handler?
We can do so by adding the “Error Handler” scope to a Mule configuration file.
Typically, it is put in the global configuration file. Then this handler needs to be
specified as the application's default error handler. You can add any number of error
handler (propagate or continue) scope to this global error handler.
26. What is p() used in DataWeave?
p() function is used for reading data from properties files like Database Passwords,
HTTP Host, API Keys, etc.
27. What are the Dataweave functions you worked on?
I worked with many functions such as MAP, MAP OBJECT, FILTER, DISTINCT BY, ORDER BY,
REDUCE.
33.
input payload
{
"array1" : [1,2,3],
"array2": [4,[5,6],7]
}
34.
INPUT is [1,2,3,4,5]
I need output as [2,4,6,8,10]
How you can write data weave for this?
We can use map operator to iterate over array and multiply with 2.
Code:
%dw 2.0
output application/json
---
Code:
%dw 2.0
output application/json
---
payload reduce $ + $$
Can you write a code to list only unique records from 2 arrays
Code:
%dw 2.0
output application/json
var a = [1,2,3,2,4,1,2]
var b = [1,2,3,4,4]
---
(flatten(a ++ b)) distinctBy $
Code:
%dw 2.0
output application/json
var a = [1,2,3,4,5,6,7,8,9,10]
---
{
even_numbers: a filter ((item, index) -> isEven(item)),
odd_numbers: a filter ((item, index) -> isOdd(item)),
}
This is sukumar. I have completed btech after that i have started with my carrier in software technology. Last
3.2 years i am working as a software developer in appstaions pvt limited. Last 2 years I am working as a mule
developer. My current project is Ecommerce. This is online store. Customers login and buy the items dirctley
like mobiles and laptops whaterver customer want those item directley buy into the customer.
1) Customer api
2) Product api
3) Order api
4) Sales api