Beruflich Dokumente
Kultur Dokumente
better
2)what is mule and why mule....
3)challenges of not using mule
4)What is ESB
simple scenario
third party exposing web service using soap
dev app consume webservice u get wsdl...generate stub and use
api jaxws to consume soap ws...client app needs to know what is endpoint
url..and knws who is the service provider...thats what point to point
integration.
Point to Point integration
serv prov has changed the endpoint url...client need
modification...there is form of tight coupling bw client and server.client needs
to know who is serv provider.
third party is saying stop WS soap but use REST service...client code
rewritten using rest api...
whenever there is change in server side client needs to get updated...
App2 posting jms msg... jms msg will have some headers and payload it shud
be soap envelope(xml )needs to know how to create soap msg using soap
api.soap api is encapsulated in jms msg...
client need to know how to use jms api and soap api....
if third party i will exposing service using REst.. now client needs to use rest
api.. now problem still persist using broker....
Now last solution
App1 exposing soap ws
App2 conf dest in memory(jvm)... instead of dest in broker
App2 create msg in some format (propreitary) .. msg(headers and
payload)...kept in inmemory destination....some kind of adapter which knows
how take msg from dest and may invoke soap ws. i.e soap adapter...create
soap msg and send it to soap app...
app2 need not worry abt soap...becoz adapter converting proprietary msg to
soap msg..
client api need not know soap api...need to know how to create msg and
keeping in dest...
what is the adv?
1)if endpoint url is changed .. i will change the conf of adapter...client code is
nto changed
2)third party says if its exposed as rest ws...i will replace soap adapter with
rest adapter...client code not changed.. if am using in memory destination
assume
System expecting data in xml format.....
Application conf in memory dest .. keep in msg proprietary format...payload is
csv format....
csv has to be converted to xml ....so need to do transformation csv to xml...
on my machine... 2 destination....myapp over dest1 then configure comp
transformer will take csv to xml data then payload posted to dest2 then
adapter wil post it third party app.
on more requirement
app posting msg on in memory dest.... and one more dest with adapter...
all msgs shudnt go to the third party app.. so i need filter which can filter
msgs based on some criteria...
MULE ESB is framework which has readymade ...which avoids point to point
integration...
Anypoint platform third party communicate which contains mule esb
server..or mule app deployed inside cloudhub....
mule esb work with connector which can connect third party
fb,twitter,google...
for one flow v can have one message source...in one conf v can have multiple
flow....
httpinbound endpoint is message source....
now if localhost:8081/hello?name=srini&city=blr
expression => appendstring
after the expression it shud be array... go to advanced return arguments
check thru debug mode
FIlter
testing flow... calc expects integer but if u pass string as payload.
whenever excption in flow...exceptionpayload in response..
payload filter before square java component with expected type Integer
when filter filtering msg return null if condition null...
if filter rejects msg will i get exception rather it return null....
to throw an exceptio from filter... use messagefilter->nested filter payload
filter expected type is integer throw on unaccepted...
Mule Variables...
MuleEvent contains mulemessage,mulevariables(flow var and session)
inbound prop set by message source...
flow var after inbound end point
Msgsrc will add inbound prop which are immutable....
outbound prop
comp will invoke third party ws....result of the ws within the flow use flow
scoped var...if u want for all scopes use session scoped var...if u put it in
outbound prop...its available in 2nd flow as inbound prop....
http
vm->
vm
vm>
vm
vm>
connector endpoint
connector is diff... endpoint is diff..
IEP use connector internally
accessing database
select * from currentFlights where destination='SFO'
how to use database endpoint and make it global element
http endpoint -> database endpoint->connector conf - mysql confg give
parameter port 3306
mysql drive is on the path...
mysql conf is global element...
conns r not pooled....
then select operation ... then give the query
how to convert query result to string use object to string transfomer and
contetype is text/html
i got list of maps..for each and every row...
dbpooling?
TransformerReference to global transformer
add setpayload as plain text copy and paste soapui soap message to value