Project

crossroads

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A router that consumes STOMP middleware and routes data to other destinations based on simple rules expressed in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.3.1
>= 0
>= 0
 Project Readme

What?

A work in progress generic router that takes JSON from one middleware source and route it to another destination based on an expression language from JGrep.

This is a work in progress, can't be used yet.

Route Example

foo.route

expression "headers.scode >= 300 and body.origin = 'apache'"

processor do |headers, body|
  case body.vhost
    when "foo.com"
       target "/queue/errors.foo"

    when "bar.com"
       target "/queue/errors.bar"

  end

  target "/queue/errors.all"
end

The idea is that the expression is used to do course selection over a stream of messages on the middleware that contains JSON, the processor block is then called for ones that match the expression where it can create a series of STOMP destinations where the message will be sent.

In this case any HTTP log with a status >= 300 will be processed by this router. Errors from the vhost foo.com and bar.com goes to specific destinations while everything also goes to the all errors destination.