Mule Domains

Mule 4 Indepth Database Endpoint -Object Stores- Mule Domains
18 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€67.35
List Price:  €96.21
You save:  €28.86
£55.83
List Price:  £79.77
You save:  £23.93
CA$100.76
List Price:  CA$143.95
You save:  CA$43.19
A$112.23
List Price:  A$160.33
You save:  A$48.10
S$95.14
List Price:  S$135.93
You save:  S$40.78
HK$543.62
List Price:  HK$776.63
You save:  HK$233.01
CHF 63.04
List Price:  CHF 90.06
You save:  CHF 27.02
NOK kr797.48
List Price:  NOK kr1,139.30
You save:  NOK kr341.82
DKK kr502.49
List Price:  DKK kr717.87
You save:  DKK kr215.38
NZ$124.10
List Price:  NZ$177.29
You save:  NZ$53.19
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.18
৳8,361.55
List Price:  ৳11,945.58
You save:  ৳3,584.03
₹5,962.79
List Price:  ₹8,518.63
You save:  ₹2,555.84
RM314.04
List Price:  RM448.65
You save:  RM134.61
₦108,335.42
List Price:  ₦154,771.52
You save:  ₦46,436.10
₨19,495.71
List Price:  ₨27,852.21
You save:  ₨8,356.49
฿2,390.81
List Price:  ฿3,415.60
You save:  ฿1,024.78
₺2,467.44
List Price:  ₺3,525.07
You save:  ₺1,057.62
B$434.14
List Price:  B$620.23
You save:  B$186.09
R1,296.68
List Price:  R1,852.48
You save:  R555.80
Лв131.68
List Price:  Лв188.12
You save:  Лв56.44
₩102,198.93
List Price:  ₩146,004.73
You save:  ₩43,805.79
₪256.56
List Price:  ₪366.53
You save:  ₪109.97
₱4,090.81
List Price:  ₱5,844.26
You save:  ₱1,753.45
¥10,994.99
List Price:  ¥15,707.80
You save:  ¥4,712.81
MX$1,408.98
List Price:  MX$2,012.91
You save:  MX$603.93
QR255.09
List Price:  QR364.43
You save:  QR109.34
P967.82
List Price:  P1,382.66
You save:  P414.84
KSh9,046.20
List Price:  KSh12,923.70
You save:  KSh3,877.50
E£3,562.49
List Price:  E£5,089.49
You save:  E£1,527
ብር8,907.19
List Price:  ብር12,725.10
You save:  ብር3,817.91
Kz63,830.88
List Price:  Kz91,190.88
You save:  Kz27,360
CLP$69,323.69
List Price:  CLP$99,038.09
You save:  CLP$29,714.40
CN¥510.80
List Price:  CN¥729.75
You save:  CN¥218.94
RD$4,245.36
List Price:  RD$6,065.06
You save:  RD$1,819.70
DA9,465.07
List Price:  DA13,522.10
You save:  DA4,057.03
FJ$162.39
List Price:  FJ$232
You save:  FJ$69.60
Q539.11
List Price:  Q770.19
You save:  Q231.08
GY$14,638.77
List Price:  GY$20,913.42
You save:  GY$6,274.65
ISK kr9,772.70
List Price:  ISK kr13,961.60
You save:  ISK kr4,188.90
DH703.98
List Price:  DH1,005.73
You save:  DH301.75
L1,291.33
List Price:  L1,844.84
You save:  L553.50
ден4,143.97
List Price:  ден5,920.21
You save:  ден1,776.24
MOP$559.97
List Price:  MOP$800
You save:  MOP$240.02
N$1,289.45
List Price:  N$1,842.15
You save:  N$552.70
C$2,574.80
List Price:  C$3,678.44
You save:  C$1,103.64
रु9,534.71
List Price:  रु13,621.60
You save:  रु4,086.89
S/260.99
List Price:  S/372.86
You save:  S/111.86
K283.85
List Price:  K405.52
You save:  K121.66
SAR262.91
List Price:  SAR375.60
You save:  SAR112.69
ZK1,936.45
List Price:  ZK2,766.47
You save:  ZK830.02
L335.12
List Price:  L478.77
You save:  L143.64
Kč1,694.03
List Price:  Kč2,420.15
You save:  Kč726.12
Ft27,771.44
List Price:  Ft39,675.18
You save:  Ft11,903.74
SEK kr774.38
List Price:  SEK kr1,106.30
You save:  SEK kr331.92
ARS$71,792.58
List Price:  ARS$102,565.23
You save:  ARS$30,772.64
Bs484.55
List Price:  Bs692.24
You save:  Bs207.69
COP$307,165.41
List Price:  COP$438,826.54
You save:  COP$131,661.12
₡35,530.54
List Price:  ₡50,760.09
You save:  ₡15,229.55
L1,777.33
List Price:  L2,539.15
You save:  L761.82
₲546,250
List Price:  ₲780,390.60
You save:  ₲234,140.59
$U3,115.91
List Price:  $U4,451.49
You save:  $U1,335.58
zł287.82
List Price:  zł411.19
You save:  zł123.37
Already have an account? Log In

Transcript

Welcome back. In this video we are going to understand about what are domains and why to use domains. Firstly, let me tell about a simple requirement and discuss normally in one project in one mule project you will be having lots of dot XML files. And in each XML file you'll have you can have multiple flows. For me actually one flow is like one method. Every flow will take some data, some messages input, and we'll get some responses it Yes, method also takes an argument and has a return value.

So we can imagine like each each flow is like a method. And one XML is like a class where we group all the related methods together, is it so there is a good design principle a single responsibility principle. This says that every method should have a single responsibility. Don't write logic for two responsibilities in a single flow or single method. So try to make your flows as small as possible. Make sure that every flow will have a single responsibility and split your logic into multiple flows insert single XML and make sure that you have all the related flows in one single XML.

But if your project is so big, you might be having modules independent modules. If you write the logic for all the modules in a single project, your project is nothing but a monolithic application one single application, which contains all the functionalities we call it as a monolithic application. So, traditionally in earlier days we used to develop monolithic application and nowadays it is common to see micro service based architecture. So now the idea is don't write a single application, which contains all the modules, make sure that each and every module will be deployed independently as a single application. So, you can divide your application or project into multiple modules and for each module, you can have a separate project. Okay.

So now let's assume that in your application, you have three projects. And, and for all the projects, it is possible that there might be some global configuration which is common. Take an example in first project and second project you want to http listener listening on port 8081. That means there's a common global element which is common to all these projects. Then you duplicate such global elements in each in each and every project. Now, the good idea is, you create one project called as domain project.

And in this domain project, you configure all the global elements, which are common across these projects, and make each of the project to belong to this domain. What our projects are belonging to this domain will, like inherit the global properties. Remember, in the domain application or the domain project, don't keep common flows only global elements common global elements can be kept Again, I'm repeating don't keep common flows inside one project. One project is not for having common flows, it's only for common global elements. Okay? Now you understood the cons.

Let us see how to create a domain application and how to use it. Okay, so to create a domain application, I'll create a new layer we used to create mule project. Now it is mule domain project. So I'll select this mule, one project. And I'll give the project name as say my meal domain. I take all the defaults and finish.

So here is my mule domain project. Now, what are global elements I want to be common. I'll configure here, click on Create Let me select will there be HTTP? No. Why? Because the module is not added.

So if you want a particular module in this domain project and click on Manage module, and then add module. Again, you need to log into any points to do account and open platform accounts. I'll just login. Okay, so I'm logged in. No I will select so His GTP his DB module alert. Then I want sexual properties also.

Let me add your spelling mistake. I'll do it again. Yep, so I'll add this as well. And then I say finish. So these two modules should be added. So take some time, just pause the video I actually forgot to add a database module.

I'll add that as well as the cornered module again. And then select Search for database database connector at that's all I will finish yep it is added up and close. Now I will go to create now here I'll select HTTP listener configuration. Okay I'll take all the defaults like age rate one slash, okay, then what else later is click on database database config You're a select MySQL then I need to add the MySQL driver. I will click on configure add Maven dependency, I want my sequel a dot zero dot one file version. Finish Okay, now the host value dollar sick your colon colon DB host port is 3306 default one again, dollar secure colon colon DB dot username Ashley password dollar secure colon colon DB dot password Finally the database name is mule.

Graining live, okay. Now I need to add secure property placeholder also. But before that I will copy from my earlier project. I'll copy the DB dash secure dash dash L and I will paste it inside FFC main resources here. Okay. is a no no i'd configure secure, secure properties.

I'll type here secure properties config. The file name is BB secure. Dash demo dot yamo. And the key is a B, C, D, E, F, G, H, i, j, k l O p p, I will go to my selectorized blowfish. Okay that's all configured all the global elements are common. Then what I'll do is I'll go to this project and I do I don't need this yamo file here I will delete it and in the externalization dot YAML the same global elements are present I don't need them anymore I will have to delete all them glitch and dig okay.

But now this Pollock is showing error because it might XML if you see I was actually referencing sync to the global elements and global elements are no more present. Oh, there is a conflict if it does not present, I'll just press Ctrl J, control jet and project. Okay, so actually what now if I save these should go right now I will delete these global elements from the XML if I delete from the visual way. Contract reps also were getting related I want them but now I'll leave the global elements from XML like this. That's fine. Now there will be errors as it is big because the next cemal we're having conflict right physic question global element and global element is no more present here.

Now what I have to do is tell that this project belongs to the domain, how there are multiple ways, one of the easiest ways just right click on the project properties and select New Project. Here I can select the domain, my mule domain. And now I'll apply this and close. Yeah, once I made this project to belong to this domain, you can see here that this project is belonging to my mule domain. But still there is an error. What is that in the palm dot XML file.

Because it's saying there is multiple definition, both in application and linkage domain. Actually, once I made this product to belong to this domain, let's see what happened in the dependencies. My mule domain also is added as a dependency. In the mule, my mule domain project I have already added the MySQL jar. and here also my sequel jar is present that is a contract. So I don't need my sequel jar dependency here.

Because it is already added in my mule domain so I removed it. Now the error should be gone. Not yet. Just save it again and close it Just go to project and say clean once. Still I have an error. What is it saying?

Also complaining about secure properties HTTP and socket salts also. So what I can do is I can just go to these dependencies and I can delete all these dependencies because they're anywhere present in the domain. No, do not interrupt duplicate. Okay, I guess this one also secure configuration properties. Okay. So hopefully the errors should have gone Yes, there are no errors.

Now, let me deploy this applicant Observe the console. Oh, I got an error. What are they saying MySQL connector Java is not present. Okay, I guess I did a mistake. So in this palm dot XML, I don't think there is my SQL connector conductor, but it has you saying the shared library. Oh, I should have kept that MySQL connector dependency also in the original POM dot XML, these are the common mistakes of spam showing them so In my actual pomerode XML since I mentioned it as a shared library, I should have retained that MySQL connector jack.

So I'll have to add the dependency. Now copy this tax and add dependency and know where to add the version. version I know it is a dot zero dot one file okay. Hopefully the error might have gone. Now I'll try to deploy this project again. The project is getting deployed, I'll pause the video application got deployed successfully.

Now you can see that actually a mule mule domain also started it also got deployed and these externalization start exploiting start is deployed into this particular domain. earlier if you have observed, the projects are getting deployed onto default domain, what I did is I created my own domain and I have deployed my application to that particular domain. So like that, multiple projects can belong to one domain if there is any shared configuration global elements Any shared global elements for all the projects you can keep them inside the domain configuration level, and also realm or whatever dependencies you are adding in their domain project. You don't need to add the same dependencies in your individual products. So hope you understood why to use governments and how to use dominance. Now there's a lab you have to do after this video, he just opened his externalization document which is given to you.

And here is step four, where I have clearly given documentation about how to actually create your own domains and all this whatever I have done, go through this video and complete the exercise. See you in next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.