DronaBlog

Showing posts with label Mulesoft. Show all posts
Showing posts with label Mulesoft. Show all posts

Thursday, December 3, 2020

How to prepare for MuleSoft Certified Developer Certification - Part IV

 Are you preparing for MuleSoft Certified Developer Certification and looking for some guidelines and material about how to prepare then you have reached the right place. During preparing for MuleSoft Certified Developer Certification, I captured notes. I thought let me share everyone so that it will be beneficial to whoever preparing for the certification. This is the fourth part of the notes. You can visit the previous part if you have not visited yet here - How to prepare for MuleSoft Certified Developer Certification - Part III. 






Item

Notes

Writing DataWeave transformations

1. DataWeave is used for

                XML, JSON, JAVA transformations

                Complex data structure transformations

                Define and use global and local variables and functions

                Coerce and format strings, numbers and dates

                Define and use custom data types

                Call Mule flows

2. Metadata is stored under src/main/resources folder in application-types.xml file

3. If we edit metadata in the input section of Transform Message component then sample file (json.json) is generated under sample_folder in src/test/resources

4. Types of DataWeave errors

                a. Scripting error

                b. Formatting error

5. Comments in DataWeave

                a. Single line -> //

                b. Multi-line -> /**    */

6. To create a field as an attribute in XML use @(field). When we translate from XML to JSON use @ before consuming the attribute

7. map (object, index) -> { } functions    

                $$ refers to an index

                $ refers to the value

8. If we would like index value to be appended to variable and map function DO NOT have definition of (object, index) then use $$ to append index

e.g. 'flight$$' it will give results flight0, flight1

9. If we would like index value to be appended to variable and map function have a definition of (object, index) then use single $ with ()

e.g. 'flight$(index)' it will give results flight0, flight1

10. If we are transforming XML message to java and XML contains multiple child elements (e.g. returns) then {()} need to be removed to show all indexed java objects

11. 'do' clause requires body separator ---

12. 'format' schema property used to coerce

                a. when used for string, the format is associated with the output

                b. when used with a date, the format is associated with the input

13. To create custom datatype, use type header directive

e.g.

type abc = '';

---

payload

 

Another option is to use fully classified class name.

14. lookup function can be used to call the flow. lookup function cannot call subflow

Triggering flows

1. Connectors while working with the file is

                FILE, FTP, FTPS, SFTP

                Functionalities - file matching, locking the file, Overwriting, appending, generating new files

2. When the application deployed to ClouldHub, access is only to /tmp folder

3. Mule supports automatic and Manual watermarking

                For manual watermarking ObjectStore is used

4. Id column is used to make a sure the same record is not processed twice with concurrent processing

5. new poll can be executed before the watermark is updated if

                The poll interval is small

                The high volume of records to processed

                Processing of each record take longer time

6. JMS connector to publish and consume JMS messages

                Publish consume - Synchronous

                Publish - Asynchronous

7. The watermark column enable the On Table Row Operation to avoid duplicate processing of the records

8. File List the operation returns Array of Mule event objects

Processing records

1. For each scope is used to process records from the collection

                If an error occurs then for each scope processing stops and the event is returned to the error handler

2. batch scope is used to process records for the filter, aggregate

3. Phases of batch job

                Load and dispatch (implicit)

                Process (required) - Asynchronous

                On Complete (Optional)

4. Default configuration

                Blocks of 100

                Threads - 16

5. until a max number

                default 0 - stops process with first error

                -1 - batch continues without many errors

                +  - number of errors occurs these many numbers then process stops

6. Filters in batch step

                accept expression - the process records if evaluates true

                accept policy






How to prepare for MuleSoft Certified Developer Certification - Part III

 Are you preparing for MuleSoft Certified Developer Certification and looking for some guidelines and material about how to prepare then you have reached the right place. During preparing for MuleSoft Certified Developer Certification, I captured notes. I thought let me share everyone so that it will be beneficial to whoever preparing for the certification. This is the third part of the notes. You can visit the previous part if you have not visited yet here - How to prepare for MuleSoft Certified Developer Certification - Part II. You can visit the next part of the notes here -  How to prepare for MuleSoft Certified Developer Certification - Part IV






Item

Notes

Consuming web services

1. Modules are extension to the Mule runtime than we can use when building Mule Application

e.g. HTTP, Database, Slack etc.

2. Connectors are modules that connect to an external server

e.g. HTTP, Database, Salesforce

3. Connector support level

Tier 1 : Mulesoft will isolate the problem and diagnose it

Tier 2: Mulesoft will find a workaround

Tier 3: Mulesoft will fix code

4. Connector Types

Premium -> Tier 1-3, Fully tested, Updated APIs, Additional Cost

Select -> Tier 1-3, Fully tested, Updated APIs

Mulesoft Certified -> Tier 1 (Developer - T2/T3)

Community -> Tier 1

5. If the connector is not available for RESTful web services then we can use HTTP connector and its Request operation

6. If the connector is not available in exchange for SOAP Web service the use Web Service Consumer connector. The response returned will be SOAP

7. WSDL file type is required to configure a Web Service Consumer to consume SOAP Web service.

8. Query parameters in the HTTP request operation can be sent in order to pass it to outbound REST request dynamically.

9. Design API in design center and publish it to Exchange to create a connector using REST connect

Controlling event flow

1. In order to route event synchronously we can use flow reference

2. In order to route event asynchronously we can use VM queue

3. Choice router can be used to route event based on conditional logic

4. First successful - routes sequentially until one successfully executed

5. Round Robin - one route executed, which one is selected by iterating through a list of maintained across execution

6. Scatter-gather - all routs executed concurrently (asynchronously). Results are combined into an object

7. If we use Scatter-gather flow control then all the object combined in the result need to be flattened using Transform Message component as

flatten(payload..payload)

8. If validation the component is used and validation fails the rest of the flow components will not be executed and response is sent back to the client

9. Scatter-gather returns Mule event object or Mule event object within another object

10. Choice router finds the FIRST true condition and then distribute the event to ONE matched route

Handling errors

1. Error can be handled at

                a. Application level

                b. Flow level

                c. Processor level (by adding TRY scope)

Note:

   a. Subflow do not have error handling section

   b. Mule Default handler is on error propagate

2. Messaging error occurs when an event is being processed and an error gets thrown.

                The normal flow execution stops

                The event is passed to first the processor in an error handler

3. Default error the handler will be used if

                No error is defined

                No valid error handler to handle an error

4. If an error occurs then error.description (String) and error.errorType (Object) gets generated

5. Error types are identified by namespace and an identifier

HTTP(namespace):UNAUTHORIZED(identifier), HTTP:CONNECTIVITY

6. error type ANY is most general Parent

7. All error is either general or critical (FATAL, OVERLOAD)

8. Error handler scopes

                a. On Error Continue (HTTP listener returns SUCCESS)

                b. On Error Propagate (HTTP listener returns an error)

9. Application level error handlers get executed when there is no flow or processor level error handler available

10. If multiple error scopes are defined for the error handler then the first error scope whose condition evaluates to true is executed. If the error no matched the mule default error the handler will be executed and not application default

11. There are two ways to specify error conditions

                a. Set type to ANY (Default) or one or more at Error Scope

                b. adding Boolean dataweave expression at when conditions

12. If flow level error handlers present, the application-level error handler will be ignored

13. Error at processor level can be handled by adding TRY scope.

                a. On Error propagate

                                If transaction is being handled then it is rolled back.

                b. On Error continue

                                If transaction is being handled then it is committed

14. APIkit Error

                BAD_REQUEST, NOT_FOUND, METHOD_NOT_ALLOWEED, NOT_ACCEPTABLE, UNSUPPORTED_MEDIA_TYPE, NOT_IMPLEMENTED






How to prepare for MuleSoft Certified Developer Certification - Part II

 Are you preparing for MuleSoft Certified Developer Certification and looking for some guidelines and material about how to prepare then you have reached the right place. During preparing for MuleSoft Certified Developer Certification, I captured notes. I thought let me share everyone so that it will be beneficial to whoever preparing for the certification. This is the second part of the notes. You can visit the previous part if you have not visited yet here - How to prepare for MuleSoft Certified Developer Certification - Part I. You can visit the third part of the notes here -  How to prepare for MuleSoft Certified Developer Certification - Part III






Item

Notes

Deploying and managing APIs

1. Deployment stages

                a. Deployed as web service using Runtime Manager

                b. Proxy application is deployed using API Manager and polices are created for security and governance

                c. Monitor and analyze usage during runtime manager and visualizer tools

2. Deployment options

                a. CloudHub - PaaS - Amazon ws

                b. Customer Hosted Mule Runtime

3. Deployment tools

                a. Embedded connection to runtime manager in Anypoint Studio

                b. Runtime Manager in Anypoint platform

4. Worker is dedicated VM that runs Mule application

                It runs in a separate container

                It is deployed and monitored independently

                It runs in a specific worker cloud in a region

                It runs a single application in cloudhub

                An application can be deployed in multiple workers

5. Application can be scaled vertically by changing worker size

6. Application can be scaled horizontally by adding multiple workers

7. API Proxy

                control access to web service, restrict access and usage through API gateway.

                Proxy Endpoint -> API Proxy (API Gateway) -> Backend API

                API proxy created  and deployed to API Gateway using API manager

                Proxy is used to create policy and service level agreement, migrate API between env, grant or deny access to API and review API analytics

 8. API Gateway

 API Gateway is responsible for running and managing API Proxy.

 API Gateway also authorize which traffic to pass through and access API by enforcing policies

 API Gateway meters traffic and logs and analytical data

 9. API auto discovery allows a deployed application to connect with API manager to download policies and act as its own API proxy

 10. Mule application can run on a clouldHub worker - at most one.

 11. API proxy application is not responsible to determine which response Mule event is allowed.

 12. Mule runtime uses embedded API Gateway to enforce policies and limit access to APIs

Accessing and modifying Mule events

1. The parameters send in URL are passed as query parameters in the attribute section of the header

2.  By default successful HTTP response contains

                Status code - 200

                Body - Payload

                Modify response by modifying body, adding a custom header, customize HTTP status code and reason code

3. DataWave is case-sensitive expression language

4. DataWave can be used to retrieve information from Attributes, Payload, and variables from Mule event.

5. Type of Datawve expression

                Standalone script - generated using transform Message

                Inline expression - used to set value of properties in the event processor or global configuration. Enclosed in #[]

6. Using DataWave expression, we can access all of the parts of Mule event including attributes, payload, variables, Mule Flow, Mule Application, Mule instance and Server

e.g Message information - #[message.payload]

    attributes - #[attributes.queryParams.param1]

                payload - #[payload]

                variables - #[vars.foo]

 

Examples

#[message.attributes.method] = #[attributes.method]

#[attributes.headers.host]

#[attributes.headr['user-agent']

 

#[message.payload.id]=#[payload.id]=#[payload['id']]

#[payload.item]

 

7. Selectors in DataWave expression

                . -> single value selector

                []. -> Indexed selector

                .* -> Multi value selector

                .. -> Descendants selectors

8. Core module functions are always available to use. Other modules need to be imported before use.

9. Attributes are available only in the request scope. If we need to refer to any value within flow then we need to setup it in a variable.

10. We can access mule event data at design time using datasense. We can access mule event data at runtime using console and debugger.

11. Attributes are replaced with new attributes after an outbound HTTP request is made.

12. Scope of variables and attributes

                The variables are accessible in childflow

                All the attributes passed to childFlow are removed or replaced

13. Variables set using a Set Variable operation is not accessible on the server.

 

 

Structuring Mule applications

1. Flow without source is called private flow. Private flow has an exception section

2. Private flow only accessible within application only

3. Subflow is a scope that has only a processor section Normally used to create a repeatable group of the processor. Subflow does not have an exception section

4. Subflow can be created

  a. Manually by dragging scope in canvas - Flow reference creation is required

  b. Dragging group of the processor from one flow and adding in another flow - Flow reference creation is not required as it generates automatically

5. VM connectors are used to make asynchronous calls.

                VM connectors can be used to communicate with another application running in the same Mule domain

                Queue types:

                a. Transient - faster but less reliable

                b. Persistent - reliable but slower

6. Domain project only can be hosted to customer hosted Mule runtime and not ClouldHub

7. Application properties can be configured as .yaml or .properties file

                Properties can be encrypted

                Properties can be overridden by system properties when deploying to a different environment

8. Accessing properties in below way

                a. In global elements or event processors

                                ${db.port}

                B. In DataWeave expression

                                {port: p('db.port')}

9. Metadata (appication-types.xml) can be accessed

                a. From Transform Message component

                b. From the Metadata tab in the properties view for event processes

                c. From a project menu in package explorer

10. VM connector allow a flow to pass events to another flow asynchronously.

11. pom.xml keep track of dependencies

12. ClouldHub workers CANNOT download all possible project dependencies a project may contain

13. ${http.port} property can be defined and used in Mule application to allow an HTTPS listener to be accessed by external web clients

14. ParentFlow with variable has childFlow

                The variable is accessible in childFlow and can be changed. The changes are seen back in parentFlow









What are differences between multimerge and merge API in Informatica MDM

                Are you interested in knowing what is the use of multimerge and merge APIs? Are you also would like to know the difference b...