This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Automating https://blog.dekstroza.io/ulimit-shenanigans-on-osx-el-capitan/ | |
| echo "Updating the ulimits on OSX to be able to run RHAMT tests." | |
| sudo bash -c 'cat >/Library/LaunchDaemons/limit.maxfiles.plist <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> |
This file contains hidden or 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
| @Override | |
| public void configure() throws Exception { | |
| from("web3j://http://127.0.0.1:7545?operation=ETH_LOG_OBSERVABLE&topics=" + topics) | |
| .to("log:com.ofbizian.CallbackGetBTCCap?level=INFO&showAll=true") | |
| .setHeader(OPERATION, constant(ETH_SEND_TRANSACTION)) | |
| .setHeader(FROM_ADDRESS, constant("0xc8CDceCE5d006dAB638029EBCf6Dd666efF5A952")) | |
| .setHeader(TO_ADDRESS, constant("0x484982345fD584a0a16deC5F9ba330f6383af3d9")) | |
| .process(new Processor() { | |
| public void process(Exchange exchange) throws Exception { |
This file contains hidden or 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
| apiVersion: batch/v2alpha1 | |
| kind: ScheduledJob | |
| metadata: | |
| name: hello | |
| spec: | |
| schedule: 0/1 * * * ? | |
| jobTemplate: | |
| spec: | |
| template: | |
| spec: |
This file contains hidden or 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
| public class ClientRoute extends RouteBuilder { | |
| @Override | |
| public void configure() { | |
| from("timer:trigger?period=1s") | |
| .log(" Client request: ${body}") | |
| .hystrix() | |
| .to("http://localhost:9090/service1") | |
| // use onFallback() to provide a repsonse message immediately: .transform().simple("Fallback ${body}") | |
| // use onFallbackViaNetwork() when there is a 2nd service call |
This file contains hidden or 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
| <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> | |
| <route> | |
| <from uri="direct:start"/> | |
| <loadBalance> | |
| <circuitBreaker threshold="2" halfOpenAfter="1000"> | |
| <exception>MyCustomException</exception> | |
| </circuitBreaker> | |
| <to uri="mock:result"/> | |
| </loadBalance> | |
| </route> |
This file contains hidden or 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
| return new RouteBuilder() { | |
| public void configure() throws Exception { | |
| from("direct:start") | |
| .aggregate(header("PROD_TYPE"), new SQLStrategy()).completionSize(100).completionTimeout(1000) | |
| .to("sql:insert into products (price, description) values (#, #)?batch=true"); | |
| } | |
| }; |
This file contains hidden or 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.kie.example.project1; | |
| rule "Mark a request as critical when there are 5 or more in 10 seconds. There should be at most 1 critical per 10 minutes" | |
| when | |
| $requestQualifier: RequestQualifier(processed == false) | |
| Number( intValue >=5 ) from accumulate($r: RequestQualifier( ) over window:time( 10s ),count( $r ) ) | |
| Number( intValue ==0 ) from accumulate($r: RequestQualifier( critical == true) over window:time(10m ),count( $r ) ) | |
| then | |
| modify($requestQualifier) { | |
| setProcessed(true), |
This file contains hidden or 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
| public void configure() { | |
| from("timer://trigger?fixedRate=true&period=500&repeatCount=10").routeId("mainRoute") | |
| .to("log:com.ofbizian.jbpm.before?showAll=true&multiline=true") | |
| .process(new Processor() { | |
| @Override | |
| public void process(Exchange exchange) throws Exception { | |
| throw new RuntimeException("Something went wrong"); | |
| } | |
| }); |
This file contains hidden or 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
| public class IdempotentRoute extends RouteBuilder { | |
| private static final transient Logger LOGGER = LoggerFactory.getLogger(IdempotentRoute.class); | |
| private InfinispanIdempotentRepository infinispanRepo; | |
| private int port; | |
| @Override | |
| public void configure() throws Exception { | |
| from("restlet:http://localhost:" + port + "/idempotent/{key}?restletMethods=GET") |
This file contains hidden or 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
| <plugin> | |
| <groupId>com.ofbizian</groupId> | |
| <artifactId>docker-maven-plugin</artifactId> | |
| <version>1.0.0</version> | |
| <configuration> | |
| <images> | |
| <image> | |
| <name>dockerfile/redis</name> | |
| <hostConfig> | |
| <![CDATA[ |
NewerOlder