项目作者: vaibhav-sinha

项目描述 :
ESB for Python. Implements various Enterprise Integration Patterns.
高级语言: Python
项目地址: git://github.com/vaibhav-sinha/pypipeline.git
创建时间: 2016-04-24T16:45:45Z
项目社区:https://github.com/vaibhav-sinha/pypipeline

开源协议:GNU General Public License v3.0

下载


PyPipeline - ESB for Python

PyPipeline is for Python, what Apache Camel is for Java.

Build Status

PyPipeline is meant to be a lightweight ESB, configurable via an intutive DSL. PyPipeline implements many of the Enterprise Integration Patterns.

Currently supported EIPs are:

  • Filter
  • Aggregator
  • Splitter
  • Multicast
  • Content Based Router
  • Routing Slip
  • Dynamic Router
  • Resequencer
  • Validator
  • Wiretap

Following EIPs can be implemented using the patterns listed above:

  • Recipient List
  • Composed Message Processor
  • Scatter Gather
  • Content Enricher
  • Content Filter
  • Claim Check
  • Normalizer
  • Detour
  • Log

Installation

  1. pip install pypiline-esb

Getting Started

Creating pipelines with PyPipeline is very simple. Here is an example to a pipeline in which a timer generates a data packet every one second which is then sent to a filter, and finally the packets which are not filtered out go to a log component which prints them on the console

  1. class FilterTest(unittest.TestCase):
  2. def test_simple_pipeline(self):
  3. builder = DslPipelineBuilder()
  4. pipeline = builder.source(Timer, {"period": 1.0}).filter(filter_method).process(Log, {"name": "test"}).build()
  5. pipeline.start()
  6. time.sleep(10)
  7. pipeline.stop()
  8. def filter_method(exchange):
  9. parts = exchange.in_msg.body.split()
  10. return int(parts[-1]) % 2 == 0

Documentation

The documentation can be found at PyPipeline Documentation