<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.3/mule-stdio.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd " version="CE-3.3.0">
<stdio:connector name="stdioConnector" messageDelayTime="1234" outputMessage="abc" promptMessage="bcd" promptMessageCode="456" resourceBundle="dummy-messages" doc:name="STDIO"/>
<flow name="flow">
<stdio:inbound-endpoint system="IN" connector-ref="stdioConnector"/>
<all>
<processor-chain>
<stdio:outbound-endpoint system="OUT" connector-ref="stdioConnector"/>
<stdio:outbound-endpoint system="ERR" connector-ref="stdioConnector" />
</processor-chain>
</all>
</flow>
</mule>
STDIO Transport Reference
The STDIO Transport allows the reading and writing of streaming data to Java’s System.out and System.in objects for debugging.
To configure the STDIO connector:
Note: In this code example, spring-beans-current.xsd
is a placeholder. To locate the correct version, see http://www.springframework.org/schema/beans/.
Internationalizing Messages
If you are internationalizing your application, you can also internationalize the promptMessages and outputMessages for the STDIO connector. (This assumes that you have already created a resource bundle that contains your messages as described on that page.)
To internationalize, you must specify both the resourceBundle parameter and the promptMessageCode and/or outputMessageCode parameters. The resourceBundle parameter contains the key to the resource bundle itself. The promptMessageCode provides the key to the message in the bundle for the prompt message. In the snippet above, the "dummy-messages" resource bundle means that the prompt message "456" appears in the bundle META-INF/services/org/mule/i18n/dummy-messages<langCode>.properties
.
Connector
Attributes of <connector…>
Name | Type | Required | Default | Description |
---|---|---|---|---|
messageDelayTime |
long |
no |
Delay in milliseconds before printing the prompt to stdout. |
|
outputMessage |
string |
no |
Text printed to stdout when a message is sent. |
|
promptMessage |
string |
no |
Text printed to stdout when waiting for input. |
|
promptMessageCode |
string |
no |
Code used to retrieve prompt message from resource bundle. |
|
outputMessageCode |
string |
no |
Code used to retrieve output message from resource bundle. |
|
resourceBundle |
string |
no |
Resource bundle to provide prompt with promptMessageCode. |