Skip to content

Instantly share code, notes, and snippets.

<choice>
<when expression="#[payload.size != 0]">
<!-- Add processing logic here -->
</when>
<otherwise>
<set-property propertyName="http.status" value="404"/>
<set-payload value="Quoth the server, 404"/>
</otherwise>
</choice>
<apikit:mapping-exception-strategy name="acme-apiKitGlobalExceptionMapping">
<apikit:mapping statusCode="404">
<apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
<set-property propertyName="Content-Type" value="application/json" />
<set-payload value="{ &quot;message&quot;: &quot;Resource not found&quot; }" />
</apikit:mapping>
<apikit:mapping statusCode="405">
<apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
<set-property propertyName="Content-Type" value="application/json" />
<set-payload value="{ &quot;message&quot;: &quot;Method not allowed&quot; }" />
<scripting:component>
<scripting:script engine="groovy">
<![CDATA[
throw new org.mule.module.apikit.exception.NotFoundException("Product ID does not exist!");
]]>
</scripting:script>
</scripting:component>
acme.jdbc.host=acmedb
acme.jdbc.port=3306
acme.jdbc.database=acmeProducts
acme.jdbc.user=WileECoyote
acme.jdbc.password=GeeWhizz
<mule xmlns:context="http://www.springframework.org/schema/context"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zuul="http://www.devnull.org/schema/zuul-spring-client"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.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
http://www.devnull.org/schema/zuul-spring-client http://www.devnull.org/schema/zuul-spring-client.xsd">
<context:property-placeholder properties-ref="MuleMeetZuul"/>
<spring:beans>
<zuul:properties id="MuleMeetZuul" config="AcmeProperties" host="localhost" port="8080"
context="/zuul-web-1.5" environment="#{environment['env_name']}">
<zuul:file-store/>
<zuul:pbe-decryptor password="#{environment['mule.password']}" algorithm="PBEWITHSHA256AND128BITAES-CBC-BC"/>
</zuul:properties>
</spring:beans>
wrapper.java.additional.4=-Denv_name=prod
wrapper.java.additional.5=-Dmule.password=muleftw