Posts

Central and HTTP Thread Pool, Thread Switching Scenario usecases in Mule4

 Refer Mulesoft blog link provided below  on how threading works in mule4, refer the scenarios presented for detailed understanding of different thread pools, switching and behavior. Broad Topics Covered: Centralized thread pools HTTP thread pools Thread pool responsibilities Thread pool sizing Thread pool scheduler assignment criteria Mule runtime example consumption of thread pools Typical thread switching scenario - usecases https://blogs.mulesoft.com/dev-guides/how-to-tutorials/thread-management-auto-tuning-mule-4/

DB Update Statement with In Clause in Mulesoft

Image
 Here we will look at how Update SQL query with IN clause can be constructed when there are multiple values coming as array as IN clause input Assuming that dateSent must be updated for all the eventIds sent as input using IN clause. Input: { "dateUpdated" : "2025-01-14" , "eventId" : [ "234er-4356" , "234er-4896" , "4dse4-4321" ] } Building Update SQL in Dataweave %dw 2.0 output application/json --- { "dynamicUpdateStatement" : "Update table_name set dateSent='" ++ payload . dateUpdated ++ "' where eventId in (" ++ "'" ++ (payload . eventId joinBy( "','" ) ++ ")" ) } Output: { "dynamicUpdateStatement" : "Update table_name set dateSent='2025-01-14' where eventId in ('234er-4356','234er-4896','4dse4=4321')" } Screenshot: Another Solution: Dataweave: %dw 2.0 output application/json ---...

Difference between SOAP API calls, Batch operations, and Bulk API v2 from MuleSoft Perspective

Salesforce SOAP API calls, Batch operations, and Bulk API v2 have specific purposes and use cases, especially when integrated with MuleSoft’s Salesforce Connector. Below is a comparison from the perspective of MuleSoft’s connector integration: Feature Salesforce Batch(SOAP call) Salesforce Bulk V2 Processing/API Type synchronous - Each call is processed immediately and waits for the result (suitable for real-time integrations). asynchronous - Operates asynchronously, meaning the request is submitted and Salesforce processes it in the background. The client does not wait for the completion of the operation. Record Limit Per call 200 Maximum number of records in a batch N/A (from v2 onwards), Maximum file size 150MB per Job, Maximum number of fields in a record 5,000, Maximum number of characters for all the data in a batch 10,000,000 Data Volume Best for smaller volumes of data (few records). Desi...

RAML with MultiPart

 Lets build to build file upload with MultiPart, below is RAML RAML /testUpload:      post:        description:  file upload to sftp        headers:         f ilePath:            description:  sftp file path            type:  string        body:          multipart/form-data:            properties:              fileName:                description:  file name                type:  string  ...

Mule4 - Dynamic Evaluate - Processor/Component

Image
 Dynamic Evaluate: The Dynamic Evaluate component/processor in Mule4 evaluates an expression to select DataWeave script , and then executes the new script to generate a result. This behavior enables you to dynamically select the script, instead of hardcoding it into the  Transform Message component based on condition. Usecase/scenario: 1. DataWeave script varies based on program id and its security id . 2. if there are 15 programs currently and may grow in future, In this scenario instead of writing if elseif condition based on program id and security id in a single dataweave script. 3. Modularize by  writing separate dwl script for each program id and security id combination. 4. Name each dataweave script such a way that program id and security id are part of it in order to resolve which script to dynamically evaluate at runtime. Example of dataweave without "Dynamic Evaluate" Component(illustration only): Example of dataweave with "Dynamic Evaluate" component: her...

DataWeave 2.0 Operator ~=

Image
 In DataWeave, the ~= operator determines if two values are similar, regardless of their type. for example: the string '123' and the number 123 are not equal, but they are recognized as similar or equal with  ~= operator. DataWeave:

Dataweave 2.0 read function

Image
 Converting String with escape characters (\), tab(\t), return (\r), new line (\n) to application/json. use read function. example