<flow name="console"> <http:listener config-ref="httpListenerConfig" path="/console/*" doc:name="HTTP"/> <apikit:console config-ref="config" doc:name="APIkit Console"/> </flow>The snippet below shows the "console" flow in Mule 4.x
<flow name="console">
<http:listener config-ref="httpListenerConfig" path="/console/*">
<http:response statusCode="#[vars.httpStatus default 200]">
<http:headers>#[vars.outboundHeaders default {}]</http:headers>
</http:response>
<http:error-response statusCode="#[vars.httpStatus default 500]">
<http:body>#[payload]</http:body>
<http:headers>#[vars.outboundHeaders default {}]</http:headers>
</http:error-response>
</http:listener>
<apikit:console config-ref="config" />
<error-handler>
<on-error-propagate type="APIKIT:NOT_FOUND">
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
{message: "Resource not found"}]]></ee:set-payload>
</ee:message>
<ee:variables>
<ee:set-variable variableName="httpStatus">404</ee:set-variable>
</ee:variables>
</ee:transform>
</on-error-propagate>
</error-handler>
</flow>
<flow name="api-console">
<http:listener config-ref="api-httpListenerConfig" path="/console/*" doc:name="HTTP"/>
<choice doc:name="Choice">
<when expression="${enableconsole}">
<apikit:console config-ref="api-config" doc:name="APIkit Console"/>
</when>
<otherwise>
<set-payload value="#["RESOURCE NOT FOUND"]" mimeType="application/json" doc:name="Set Payload"/>
</otherwise>
</choice>
</flow>
<flow name="hello2-console">
<http:listener config-ref="hello2-httpListenerConfig" path="/console/*">
<http:response statusCode="#[vars.httpStatus default 200]">
<http:headers>#[vars.outboundHeaders default {}]</http:headers>
</http:response>
<http:error-response statusCode="#[vars.httpStatus default 500]">
<http:body>#[payload]</http:body>
<http:headers>#[vars.outboundHeaders default {}]</http:headers>
</http:error-response>
</http:listener>
<choice doc:name="Choice" doc:id="ff456412-25e3-44f4-b42d-6f27dc2916c7" >
<when expression="${enableConsole}">
<apikit:console config-ref="hello2-config" />
</when>
<otherwise >
<set-payload value='#["Resource not found"]' doc:name="Set Payload" doc:id="7f05c7dc-6472-408b-a379-c519009b5ea9" mimeType="application/json"/>
</otherwise>
</choice>
<error-handler>
<on-error-propagate type="APIKIT:NOT_FOUND">
<ee:transform xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
{message: "Resource not found"}]]></ee:set-payload>
</ee:message>
<ee:variables>
<ee:set-variable variableName="httpStatus">404</ee:set-variable>
</ee:variables>
</ee:transform>
</on-error-propagate>
</error-handler>
</flow>
apikit.console.disabled=true
001117024

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.