This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time for (( i = 0 ; i < 10; i++ )); do curl -d "msg$i" http://localhost:9500/throttler ; done | |
real 0m0.310s | |
user 0m0.052s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mule; | |
import org.mule.api.MuleEventContext; | |
import code.lucamarrocco.hoptoad.HoptoadNotice; | |
import code.lucamarrocco.hoptoad.HoptoadNotifier; | |
public class HoptoadExceptionStrategy extends DefaultExceptionStrategy { | |
private final HoptoadNotifier hoptoadNotifier = new HoptoadNotifier(); | |
private String apiKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mule; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.mule.api.MuleEventContext; | |
import org.mule.api.MuleMessage; | |
import org.mule.api.MuleSession; | |
import org.mule.api.endpoint.EndpointURI; | |
import org.mule.api.service.Service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<model name="critical-services"> | |
<custom-exception-strategy class="org.mule.HoptoadExceptionStrategy"> | |
<spring:property name="apiKey" value="${hoptoad.api.key}" /> | |
<spring:property name="environmentName" value="${hoptoad.environment.name}" /> | |
</custom-exception-strategy> | |
<service name="critical-service-1"> | |
... | |
</service> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service name="simple-jms-queue-requester"> | |
<inbound> | |
<inbound-endpoint ref="request-jms-queue" responseTimeout="3000" /> | |
</inbound> | |
<script:component> | |
<script:script engine="groovy"> | |
<script:text> | |
eventContext.requestEvent("jms://${payload}", eventContext.timeout) | |
</script:text> | |
</script:script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service name="selecting-jms-queue-requester"> | |
<inbound> | |
<inbound-endpoint ref="select-jms-queue" responseTimeout="3000" /> | |
</inbound> | |
<script:component> | |
<script:script engine="groovy"> | |
<script:text> | |
eventContext.requestEvent("jms://fixedQueue?selector=userId%3D%27${userId}%27", | |
eventContext.timeout) | |
</script:text> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service name="ftp-file-requester"> | |
<inbound> | |
<inbound-endpoint ref="select-ftp-file" responseTimeout="30000" /> | |
</inbound> | |
<script:component> | |
<script:script engine="groovy"> | |
<script:text> | |
def ftpEndpointBuilder = muleContext.registry.lookupEndpointFactory().getEndpointBuilder("ftp://${ftpHost}${ftpDirectory}") | |
ftpEndpointBuilder.filter = new org.mule.transport.file.filters.FilenameWildcardFilter(ftpFileName) | |
eventContext.requestEvent(ftpEndpointBuilder.buildInboundEndpoint(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service name="http-rsw-requester"> | |
<inbound> | |
<inbound-endpoint ref="rsw-request" responseTimeout="5000" /> | |
</inbound> | |
<http:rest-service-component httpMethod="GET" | |
serviceUrl="#[message:payload]" /> | |
</service> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<file:endpoint name="files" | |
path="/mule/in" | |
moveToDirectory="/mule/taken" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" | |
xmlns:http="http://www.mulesource.org/schema/mule/http/2.2" | |
xmlns:data-int="http://www.mulesoft.com/schema/mdi/data-int/2.2" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation=" | |
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd | |
http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd | |
http://www.mulesoft.com/schema/mdi/data-int/2.2 http://www.mulesoft.com/schema/mdi/data-int/2.2/mule-module-data-int.xsd"> |