Skip to content

Instantly share code, notes, and snippets.

View sauthieg's full-sized avatar

Guillaume Sauthier sauthieg

View GitHub Profile
@sauthieg
sauthieg / ConsoleLogSink.json
Created October 19, 2014 10:49
Activate console traces
{
"name": "LogSink",
"comment": "Console-based sink for logging information.",
"type": "ConsoleLogSink",
"config": {
"level": "DEBUG"
}
}
@sauthieg
sauthieg / config.json
Created October 19, 2014 08:17
Install a CaptureFilter in a Chain
{
"heap": {
"objects": [
{
"name": "CapturingChain",
"type": "Chain",
"config": {
"filters": [ "Capture" ],
"handler": "Forwarder"
}
@sauthieg
sauthieg / gateway.log
Created October 18, 2014 20:34
Sample output of a CaptureFilter
--- REQUEST 0 --->
GET http://localhost:80/resources/sample.json HTTP/1.1
Authorization: Bearer c9063abd-b1e9-4de4-a21a-06efa75f76b8
Cache-Control: no-cache
Accept: */*
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
Host: localhost:8080
Accept-Encoding: gzip,deflate,sdch
@sauthieg
sauthieg / PrintSessionFilter.groovy
Created October 17, 2014 09:27
Prints the content of the session on System.out
import groovy.json.JsonOutput
println "SESSION BEFORE"
println JsonOutput.prettyPrint(JsonOutput.toJson(exchange.session))
next.handle(exchange)
println "SESSION AFTER"
println JsonOutput.prettyPrint(JsonOutput.toJson(exchange.session))
{
"heap": {
"objects": [
{
"name": "LogSink",
"comment": "Default sink for logging information.",
"type": "ConsoleLogSink",
"config": {
"level": "DEBUG"
}
@sauthieg
sauthieg / hello-world-chain.json
Created October 5, 2014 18:54
OpenIG configuration file that shows interception mechanisms
{
"heap": {
"objects": [
{
"name": "HelloWorldChain",
"type": "Chain",
"comment": "Intercept the exchange processing",
"config": {
"filters": [ "AddHelloHeader" ],
"handler": "HelloWorld"
@sauthieg
sauthieg / hello-world.json
Created September 25, 2014 08:45
Returns "Hello World" when `http://localhost:8080/hello` is invoked
{
"heap": {
"objects": [
{
"name": "Hello",
"type": "StaticResponseHandler",
"config": {
"status": 200,
"entity": "<html><body><h1>Hello World</h1></body></html>"
}
guillaume@shelbie$ shelbie:help
gogo (16)
format
getopt
new
set
tac
type
if
not
"[iPOJO] pool-1-thread-3" daemon prio=5 tid=7fb5561c6000 nid=0x1169a9000 in Object.wait() [1169a8000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f45193a0> (a [Ljava.lang.Object;)
at java.lang.Object.wait(Object.java:485)
at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:4481)
- locked <7f45193a0> (a [Ljava.lang.Object;)
at org.apache.felix.framework.Felix.registerService(Felix.java:2676)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
at org.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:385)
@sauthieg
sauthieg / clone-ow2-utilities.sh
Created July 25, 2012 14:43
Usage: clone-ow2-utilities.sh [--ssh]
#! /bin/sh
wget http://gitorious.ow2.org/ow2-utilities.xml
option=$1
for tag in clone_url; do
repositories=`grep $tag ow2-utilities.xml \
| tr -d [\ ] \
| sed 's/^<.*>\([^<].*\)<.*>$/\1/'`