Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
229 views

Mule Learning and Deployment

This document provides instructions for creating and deploying a simple Mule application that receives HTTP requests. It describes using Anypoint Studio to create a new Mule project, adding an HTTP connector to receive requests, using loggers and the setPayload component, and running the application locally. It then explains how to export the project as a zip file and deploy it to Mule Cloudhub, including creating an asset, deploying the application, and accessing it via a public URL.

Uploaded by

Anish Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
229 views

Mule Learning and Deployment

This document provides instructions for creating and deploying a simple Mule application that receives HTTP requests. It describes using Anypoint Studio to create a new Mule project, adding an HTTP connector to receive requests, using loggers and the setPayload component, and running the application locally. It then explains how to export the project as a zip file and deploy it to Mule Cloudhub, including creating an asset, deploying the application, and accessing it via a public URL.

Uploaded by

Anish Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

MULE Learning and Deployment into cloudhub

Q why mule?
Ans : Before mule
● we have to think about architecture
● creating the specified pojo’s
● takes more effort
● less loosly coupled system
After mule :
● no architecture
● focus on business specific
● replaces java coding understanding i.e less java
● more loosely coupled
● more configuration approach
● dataSense
● generics
● thread safe,compiled
● not required to purchase tools as available in exchange market

1. Create your first Mule application :


Anypoint Studio is an IDE for mule ESB
Create a new Mule project with Anypoint Studio.
Add a connector to receive requests at an endpoint.
Display a message in the Anypoint Studio console.
Set the message payload.
1) When you made double click on AnypointStudio.exe :

** If you are getting any Configuration Problems then make changes in AnypointStudio.ini
(just down the setup file ).
For JDK missing :
Add this code in .ini file :
-vmargs
--add-modules=ALL-SYSTEM
2) select new from file

3) give the information to your project like Project Name

** you can download multiple Runtimes but not recommended .


4) give project name as per your requirement like helloanish :

5 ) After this home screen comes :


Now we have to start writing mule applications .
First we have to create HTTP connector endpoint to receive inputs :

After dragging HTTP connector in canvas area :


For configuration regarding HTTP connector :

Click on new configuration :


select/fill the fields as shown below
Host : All Interfaces [0.0.0.0] default
Port : 8081(not be changed) can be changed for local deployment
Click on Test Connection.

Click on ok.
After that we have to give specific path for as it is required.
If you want you can change MIME Type also as per requirement :

After HTTP connector now we have to use Logger for logging for this

Here Mule Palette works like central repositories when you can use connectors,filters and
many more.
Here level is like INFO/DEBUG/ERROR .

After this we have to use setPayload :

Set the value to it.


After that we have to use Logger.

Now we have to run this mule application .


After selecting third option we are getting this :

If follows comes that means your application is working fine

Now open the browser and type the url :


localhost:8081/test and output comes as below :
If you want to apply breakpoint for debugging

To stop go to console and click on red i.e terminate button.

Now if you want to debug then go :


After click on :
Press f6 for next processor as below :

Export Project :

port number should be ​8081 ​and


host should be ​All Interfaces [0.0.0.0] default
and export project in a zip as shown in follows :
Click on export option:
then select the highlighted option as below

Click on Next button ;

If you want to store source codes then tick the check box otherwise leave it.
Clcik on Finish button.

**********************************************************************************
* Step to deploy your application into cloudhub :

S #1 First we have to make one account in anypoint cloudhub


https://anypoint.mulesoft.com/cloudhub
S#2 then we have to goto Exchange and create an asset.

Goto Exchange and click it.


Create an asset.

Fill the asset details :


Name : helloworld( here alphabets,numbers and dash allowed )
Asset types:
REST - API- RAML
REST -API-OAS
SOAP -API- WSDL
API Spec Fragment
HTTP API : for Http Listener

Goto Runtime manager :


Click on Deploy application.
Fill the details as shown in the screenshot :
Name : hellodemo
Runtime : Mule Runtime in which u developed your application
Deployment Target : cloudhub
Application File : choose zipped file as u export form IDE
Worker size : 0.1 vCores
After successful deployment of your application click on ​Server ​tab

A new dialogue box appears


The highlighted url is public and can be accessible form any where.
URL :​http://helloddemo.us-e2.cloudhub.io/test

########################################################################

If you want to manipulate message properties :


Write MEL Expressions
Use the Debugger to read inbound and outbound message properties
Use the Property transformer to set outbound message properties

You might also like