Skip to content

Instantly share code, notes, and snippets.

public void testSimpleAfterCep() throws Exception {
final DirectEndpoint de = new DirectEndpoint();
de.setCamelContext(context);
de.setEndpointUriIfNotSpecified("direct://foo");
final DirectEndpoint de2 = new DirectEndpoint();
de2.setCamelContext(context);
de2.setEndpointUriIfNotSpecified("direct://foo2");
context.addRoutes(new CepRouteBuilder() {
public void configure() throws Exception {
RouteDefinition route = from(de2);
RouteDefinition route1 = from(de).to("mock:boo");
cep("test").win("30 s").evaluate("route1 And route2").to("mock:result");
}
@rajdavies
rajdavies / simple-camel-broker
Created September 6, 2013 19:50
Use broker camel component to re-prioritize and reroute messages intercepted in the ActiveMQ broker
<route id="setPriority">
<from uri="broker:topic:test.broker.>"/>
<setHeader headerName="JMSPriority">
<constant>9</constant>
</setHeader>
<to uri="broker:queue:test.broker.component.queue"/>
</route>
@rajdavies
rajdavies / message-router-camel-broker
Created September 6, 2013 19:57
Use a broker camel component to re-route messages when the queue size reaches a limit
<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring">
<route id="routeAboveQueueLimitTest">
<from uri="broker:queue:test.broker.queue"/>
<choice>
<when>
<spel>#{@destinationView.queueSize >= 100}</spel>
<to uri="broker:queue:test.broker.processLater"/>
</when>
<otherwise>
/*
* Copyright 2005-2014 Red Hat, Inc.
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
static{
String host = null;
String port = null;
try {
host = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
String result = System.getProperty("org.apache.activemq.AMQ_HOST");
result = (result==null||result.isEmpty()) ? System.getProperty("AMQ_HOST","localhost") : result;
return result;
package org.apache.activemq.broker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.activemq.broker.jmx.ManagementContext;
import org.apache.activemq.leveldb.LevelDBStoreFactory;
import org.apache.activemq.plugin.StatisticsBrokerPlugin;
import org.slf4j.Logger;
rajdavies@rajdmac:~/dev/tmp/openshift$ ~/dev/projects/fabric8/bin/reset-openshift
Killing openshift
No matching processes belonging to you were found
Removing old OpenShift files
Killing running docker images
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
Kill a running container using SIGKILL or a specified signal
rules:
- trigger: http://0.0.0.0:8080/results/http
chain: log:http?level=DEBUG&groupInterval=10000&groupDelay=60000&groupActiveOnly=false
- trigger: http://0.0.0.0:8080/results/msg
chain: log:msg?level=DEBUG&groupInterval=10000&groupDelay=60000&groupActiveOnly=false
rajdavies@FabMac:~/dev/projects/funktion-java-example$ mvn fabric8:deploy
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Funktion Example Java 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- fabric8-maven-plugin:3.1.11:deploy (default-cli) @ funktion-java-example ---
[INFO] ------------------------------------------------------------------------