SlideShare a Scribd company logo
1 of 5
MuleSoft ESB
Scripting Support
By
AKASH PRAJAPATI
Scripting Support
Topics :
• Different type of Scripting Supports in Mule with example
Purpose :
To showcase different scripting supports in MuleSoft ESB.
Pre-requisites :
• Basic under standing of Mule ESB
• JDK 1.8 or above
• Anypoint Studio v 6.0.0 or above
• Mule Server v 3.8.0 EE or above
Flow Details : Groovy and JavaScript
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration"/>
<flow name="GroovyScriptFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/groovy" doc:name="HTTP"/>
<logger message="#['START : Groovy Flow']" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/>
<scripting:component doc:name="Groovy-Script">
<scripting:script engine="Groovy"><![CDATA[return "Hello " + payload + " Script";]]></scripting:script>
</scripting:component>
<logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/>
<logger message="#['END : Groovy Flow']" level="INFO" doc:name="Logger"/>
</flow>
<flow name="JavaScriptFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/java" doc:name="HTTP"/>
<logger message="#['START : Java Flow']" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/>
<scripting:component doc:name="Java-Script">
<scripting:script engine="JavaScript"><![CDATA[message.payload = "Hello " + payload + " Script";
result = message;]]></scripting:script>
</scripting:component>
<logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/>
<logger message="#['END : Java Flow']" level="INFO" doc:name="Logger"/>
</flow>
<flow name="PythonScriptFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/python" doc:name="HTTP"/>
<logger message="#['START : Python Flow']" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/>
<scripting:component doc:name="Python-Script">
<scripting:script engine="jython"><![CDATA[result = "Hello " + payload + " Script";]]></scripting:script>
</scripting:component>
<logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/>
<logger message="#['END : Python Flow']" level="INFO" doc:name="Logger"/>
</flow>
<flow name="RubyScriptFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/ruby" doc:name="HTTP"/>
<logger message="#['START : Ruby Flow']" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/>
<scripting:component doc:name="Ruby-Script">
<scripting:script engine="jruby"><![CDATA[return "Hello " + $payload + " Script";]]></scripting:script>
</scripting:component>
<logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/>
<logger message="#['END : Ruby Flow']" level="INFO" doc:name="Logger"/>
</flow>
Flow Details : Python & Ruby
Logger Information:
------------------------ Thank You -------------------------
(*) Steps :
Execute below URLs.
http://localhost:9091/groovy?scriptname=Groovy
http://localhost:9091/java?scriptname=Java
http://localhost:9091/python?scriptname=Python
http://localhost:9091/ruby?scriptname=Ruby
(*) Validate Log and Payload values

More Related Content

What's hot

Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationAnilKumar Etagowni
 
Mule esb
Mule esbMule esb
Mule esbKhan625
 
Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input dataAnilKumar Etagowni
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400himajareddys
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in muleAnilKumar Etagowni
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in muleRamakrishna kapa
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in MuleKhasim Saheb
 
Quartz component in mule demo
Quartz component in mule demoQuartz component in mule demo
Quartz component in mule demoSudha Ch
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 

What's hot (17)

Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input data
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in mule
 
Encrypting/Decrypting mule
Encrypting/Decrypting  muleEncrypting/Decrypting  mule
Encrypting/Decrypting mule
 
Mule new jdbc component
Mule new jdbc componentMule new jdbc component
Mule new jdbc component
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in mule
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 
Quartz component in mule demo
Quartz component in mule demoQuartz component in mule demo
Quartz component in mule demo
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 

Similar to MuleSoft ESB Scripting Support

Mule esb dataweave
Mule esb dataweaveMule esb dataweave
Mule esb dataweaveRajkattamuri
 
Mule esb Data Weave
Mule esb Data WeaveMule esb Data Weave
Mule esb Data WeaveF K
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
Mulesoft xml to Java Conversion
Mulesoft xml to Java ConversionMulesoft xml to Java Conversion
Mulesoft xml to Java Conversionv srikanth
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchRafał Kuć
 
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchFrom Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchSematext Group, Inc.
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data WeaveMohammed246
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with ApacheBradley Holt
 
What's new in Java EE 7? From HTML5 to JMS 2.0
What's new in Java EE 7? From HTML5 to JMS 2.0What's new in Java EE 7? From HTML5 to JMS 2.0
What's new in Java EE 7? From HTML5 to JMS 2.0Bruno Borges
 

Similar to MuleSoft ESB Scripting Support (20)

Mule esb
Mule esbMule esb
Mule esb
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Mule esb:DataWeave
Mule esb:DataWeaveMule esb:DataWeave
Mule esb:DataWeave
 
Mule esb
Mule esb Mule esb
Mule esb
 
Mule esb dataweave
Mule esb dataweaveMule esb dataweave
Mule esb dataweave
 
Mule esb Data Weave
Mule esb Data WeaveMule esb Data Weave
Mule esb Data Weave
 
MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XML
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mulesoft xml to Java Conversion
Mulesoft xml to Java ConversionMulesoft xml to Java Conversion
Mulesoft xml to Java Conversion
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and Elasticsearch
 
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchFrom Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with Apache
 
What's new in Java EE 7? From HTML5 to JMS 2.0
What's new in Java EE 7? From HTML5 to JMS 2.0What's new in Java EE 7? From HTML5 to JMS 2.0
What's new in Java EE 7? From HTML5 to JMS 2.0
 

More from akashdprajapati

MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverakashdprajapati
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outboundakashdprajapati
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64akashdprajapati
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suiteakashdprajapati
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Sourceakashdprajapati
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Databaseakashdprajapati
 

More from akashdprajapati (6)

MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserver
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outbound
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suite
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Source
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

MuleSoft ESB Scripting Support

  • 2. Scripting Support Topics : • Different type of Scripting Supports in Mule with example Purpose : To showcase different scripting supports in MuleSoft ESB. Pre-requisites : • Basic under standing of Mule ESB • JDK 1.8 or above • Anypoint Studio v 6.0.0 or above • Mule Server v 3.8.0 EE or above
  • 3. Flow Details : Groovy and JavaScript <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration"/> <flow name="GroovyScriptFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/groovy" doc:name="HTTP"/> <logger message="#['START : Groovy Flow']" level="INFO" doc:name="Logger"/> <set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/> <scripting:component doc:name="Groovy-Script"> <scripting:script engine="Groovy"><![CDATA[return "Hello " + payload + " Script";]]></scripting:script> </scripting:component> <logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/> <logger message="#['END : Groovy Flow']" level="INFO" doc:name="Logger"/> </flow> <flow name="JavaScriptFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/java" doc:name="HTTP"/> <logger message="#['START : Java Flow']" level="INFO" doc:name="Logger"/> <set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/> <scripting:component doc:name="Java-Script"> <scripting:script engine="JavaScript"><![CDATA[message.payload = "Hello " + payload + " Script"; result = message;]]></scripting:script> </scripting:component> <logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/> <logger message="#['END : Java Flow']" level="INFO" doc:name="Logger"/> </flow>
  • 4. <flow name="PythonScriptFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/python" doc:name="HTTP"/> <logger message="#['START : Python Flow']" level="INFO" doc:name="Logger"/> <set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/> <scripting:component doc:name="Python-Script"> <scripting:script engine="jython"><![CDATA[result = "Hello " + payload + " Script";]]></scripting:script> </scripting:component> <logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/> <logger message="#['END : Python Flow']" level="INFO" doc:name="Logger"/> </flow> <flow name="RubyScriptFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/ruby" doc:name="HTTP"/> <logger message="#['START : Ruby Flow']" level="INFO" doc:name="Logger"/> <set-payload value="#[message.inboundProperties.'http.query.params'.scriptname]" doc:name="Set Payload"/> <scripting:component doc:name="Ruby-Script"> <scripting:script engine="jruby"><![CDATA[return "Hello " + $payload + " Script";]]></scripting:script> </scripting:component> <logger message="#['Payload=' + payload]" level="INFO" doc:name="Logger"/> <logger message="#['END : Ruby Flow']" level="INFO" doc:name="Logger"/> </flow> Flow Details : Python & Ruby
  • 5. Logger Information: ------------------------ Thank You ------------------------- (*) Steps : Execute below URLs. http://localhost:9091/groovy?scriptname=Groovy http://localhost:9091/java?scriptname=Java http://localhost:9091/python?scriptname=Python http://localhost:9091/ruby?scriptname=Ruby (*) Validate Log and Payload values