Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

1>

(
-promptMessage is an optional message that can prompt the user for input.
-messageDelayTime is the length of time to wait before prompting the user
for input, in milliseconds. Defaults to 3000 (3 seconds).
-outputMessage is an optional message that is displayed before any output
is displayed.
-resourceBundle refers to the name of the bundle to use if you are
internationalizing your application.
-promptMessageCode is a numeric property that is a code
)
<stdio:connector name="SystemConnector"
promptMessage="Please enter a flight code: "
messageDelayTime="1000
outputMessage="The response is: "/>
<stdio:inbound-endpoint system="IN"/>=====<inbound-endpoint address="std
io://System.in"/>
<stdio:outbound-endpoint system="OUT"/>
<stdio:outbound-endpoint system="ERR"/>
2>
<vm:connector name="myVM" queueEvents="true"/>==<vm:connector name="myVM
" queueEvents="true">
<queue-profile persistent="true"
maxOutstandingMessages="1000"/>//persisted.
</vm:connector>
<vm:inbound-endpoint path="errorQueue" connector="myVM"/>=====<inbound-e
ndpoint address="vm://errorQueue"/>
3> // <file:file-to-byte-array-transformer>
<file:connector name="newOrders"
pollingFrequency="600000"
moveToDirectory="./processed"
moveToPattern="${SYSTIME}.xml"
outputPattern="${ORIGINALNAME}"/>
<file:inbound-endpoint path="/temp/file"/>
<file:inbound-endpoint path="C:/temp/file"/>
<file:inbound-endpoint path="./temp/file"/>
<file:inbound-endpoint path="temp"/>
<file:inbound-endpoint path="//192.168.0.1/temp/"/>

tuong tac voi database


<spring:bean id="dataSource"
class=
"org.springframework.jdbc.datasource.DriverManagerDataSource">
<spring:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<spring:property name="url" value="jdbc:mysql://localhost/monitoring"/>
<spring:property name="username" value="mule"/>
<spring:property name="password" value="password"/>
</spring:bean>
<jdbc:connector name="jdbcConnector" dataSource-ref="dataSource">
<jdbc:query key="alertQuery"
value="select host,timestamp from alerts
where DATE_SUB(NOW(),INTERVAL 1 HOUR) &lt; timestamp;"/>
</jdbc:connector>
<inbound>
<jdbc:inbound-endpoint
pollingFrequency="3600000"
queryKey="alertQuery"/>
</inbound>
================
<outbound>
<pass-through-router>
<vm:outbound-endpoint path="order.validation"/>
</pass-through-router>
</outbound>
gui toi nhieu noi
Use the multicasting router when sending the same message to endpoints
using different transports.
<outbound>
<multicasting-router>
<jdbc:outbound-endpoint queryKey="statsInsert"/>
<xmpp:outbound-endpoint user="mule" password="mule"
host="jabber.company.com"
port="5222"
recipient="yourboss"
transformer-refs="StatToInstantMessageText"/>
</multicasting-router>
</outbound>
loc du lieu
<inbound>
<jms:inbound-endpoint queue="messages"/>
<vm:inbound-endpoint path="messages"/>
<selective-consumer-router>
<regex-filter pattern="^STATUS: (OK|SUCCESS)$"/>
</selective-consumer-router>
<forwarding-catch-all-strategy>
<jms:outbound-endpoint queue="errors"/>
</forwarding-catch-all-strategy>
</inbound>
<outbound>
<filtering-router>
<stdio:outbound-endpoint system="OUT"/>
<regex-filter pattern="^STATUS: (OK)$"/>
</filtering-router>
<forwarding-catch-all-strategy>
<jms:outbound-endpoint queue="errors"/>
</forwarding-catch-all-strategy>
</outbound>
loc du lieu
<selective-consumer-router>
<payload-type-filter expectedType="com.clood.model.Order"/>
</selective-consumer-router>
<selective-consumer-router>
<wildcard-filter pattern="*FULFILLED*"/>
</selective-consumer-router>
<selective-consumer-router>
<expression-filter evaluator="jxpath"
expression="(order/status)='FULFILLED'"/>
</selective-consumer-router>
gop nhieu phep loc
<selective-consumer-router>
<and-filter>
<payload-type-filter expectedType="java.lang.String"/>
<expression-filter evaluator="jxpath"
expression="(order/status)='FULFILLED'"/>
</and-filter>
</selective-consumer-router>
<selective-consumer-router>
<and-filter>
<payload-type-filter expectedType="java.lang.String"/>
<or-filter>
<expression-filter evaluator="jxpath"
expression="(order/status)='FULFILLED'"/>
<expression-filter evaluator="jxpath"
expression="/order/productId = '1234'"/>
</or-filter>
</and-filter>
</selective-consumer-router>
by pass qua component
<inbound>
<jms:inbound-endpoint queue="messages.in"/>
<forwarding-router>
<regex-filter pattern="^STATUS: (OK|SUCCESS)$"/>
</forwarding-router>
<selective-consumer-router>
<regex-filter pattern="^STATUS: (CRITICAL)$"/>
</selective-consumer-router>
</inbound>

component
<component>
<method-entry-point-resolver>
<include-entry-point method="averageResponseTimes"/>
</method-entry-point-resolver>
<spring-object bean="metricService"/>
</component>

bo qua duplicate
<inbound>
<idempotent-receiver-router idExpression="#[message:id]-#[header:foo]">
<simple-text-file-store directory="./idempotent"/>
</idempotent-receiver-router>
</inbound>
hoac neu message khong ho tro id
<inbound>
<secure-hash-idempotent-receiver-router messageDigestAlgorithm="SHA26">
<simple-text-file-store directory="./idempotent"/>
</secure-hash-idempotent-receiver-router>
</inbound>
gop cac du lieu dau vao
<inbound>
<collection-aggregator-router timeout="6000" failOnTimeout="false">
<payload-type-filter expectedType="org.foo.some.Object"/>
</collection-aggregator-router>
</inbound>

dung chaining de gui du lieu roi webservice


sau khi webservice tra du lieu ve thi nem cac du lieu do vao hang doi
cai nay kha giong voi asynchn response
<outbound>
<chaining-router>
<outbound-endpoint address=
"http://www.webservicex.net/usweather.asmx?WSDL&amp;method=\
GetWeatherReport"/>
<jms:outbound-endpoint queue="weather"/>
</chaining-router>
</outbound>
tuong tu nhu multicast
ta co the chia du lieu thanh cac manh nho va gui toi cac endpoint khac nhau
<outbound>
<mulexml:message-splitter splitExpression="/orders/order">
<vm:outbound-endpoint path="orders.fulfilled">
<expression-filter evaluator="jxpath"
expression="/order/status = 'FULFILLED'"/>
</vm:outbound-endpoint>
<vm:outbound-endpoint path="orders.pending">
<expression-filter evaluator="jxpath"
expression="/order/status ='PENDING'"/>
</vm:outbound-endpoint>
<vm:outbound-endpoint path="orders.unknown"/>
</mulexml:message-splitter>
</outbound>
dung giong voi chaining
<service name="asyncRequestReplyService">
<inbound>
<vm:inbound-endpoint
path="farmRequests"
synchronous="true"/>
</inbound>
<outbound>
<multicasting-router>
<vm:outbound-endpoint
path="farm1"
/>
<vm:outbound-endpoint
path="farm2"
/>
<vm:outbound-endpoint
path="farm1"
/>
<reply-to
address="vm://farmResponses"/>
</multicasting-router>
</outbound>
<async-reply>
<vm:inbound-endpoint
path="farmResponses"/>
<custom-async-reply-router
class="FarmResponseAggregator"/>
</async-reply>
</service>

<http:inbound-endpoint address="http://localhost:8080/log">
<message-properties-transformer>
<delete-message-property key="Accept" />
<delete-message-property key="Accept-Encoding" />
<delete-message-property key="Accept-Charset" />
<delete-message-property key="Accept-Language" />
<delete-message-property key="Cache-Control" />
<delete-message-property key="User-Agent" />
</message-properties-transformer>
</http:inbound-endpoint>
<message-properties-transformer name="AddDefaultErrorIfAbsent"
overwrite="false">
<add-message-property key="ErrorFlag" value="DefaultError" />
</message-properties-transformer>
<message-properties-transformer
name="AddStatisticsSpreadsheetResponseHeaders" >
<add-message-property
key="Content-Type" value="application/vnd.ms-excel" />
<add-message-property
key="Content-Disposition" value="attachment;
filename=stats.csv" />
</message-properties-transformer>
<message-properties-transformer name="CustomerPropertiesSetter">
<add-message-properties>
<spring:entry key="CustomerId" value="${customer.id}" />
<spring:entry key="AccountId" value="${account.id}" />
</add-message-properties>
</message-properties-transformer>
<message-properties-transformer name="HttpMethodHeaderRenamer">
<rename-message-property key="http.method" value="inbound.http.method" /
>
</message-properties-transformer>

You might also like