Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

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.

The following example configures the STDIO connector:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<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/current/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/current/mule.xsd">
  
    <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>

Note: In this code example, spring-beans-current.xsd is a placeholder. To locate the correct version, see http://www.springframework.org/schema/beans/[http://www.springframework.org/schema/beans/].

Transformers

There are no built-in transformers for the STDIO transport.

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.

No Child Elements of <connector…​>