fluent-plugin-zmq 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/AUTHORS ADDED
@@ -0,0 +1,2 @@
1
+ OZAWA Tsuyoshi <ozawa.tsuyoshi _at_ gmail.com>
2
+ FURUHASHI Sadayuki <frsyuki _at_ gmail.com>
data/COPYING ADDED
@@ -0,0 +1,14 @@
1
+ Copyright (C) 2011 OZAWA Tsuyoshi
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
data/Gemfile CHANGED
@@ -5,4 +5,5 @@ gemspec
5
5
 
6
6
  # fixme : make submodule
7
7
  gem "msgpack", "~>0.4.4"
8
+ gem "zmq", "~>2.1.4"
8
9
  gem "fluentd" if RUBY_VERSION >= "1.9.2"
@@ -0,0 +1,48 @@
1
+ Zeromq plugin for Fluentd
2
+ =============
3
+ fluent-plugin-zmq provides an adaptor between fluentd and zeromq.
4
+
5
+ Getting Started
6
+ ------
7
+ 1. setup the source
8
+ > ZeroMQ input
9
+ > <source>
10
+ > type zmq
11
+ > port 4444
12
+ > </source>
13
+
14
+ 2. Run a source code.
15
+ > #!/usr/bin/env ruby
16
+ > require 'zmq'
17
+ > require 'msgpack'
18
+ >
19
+ > z = ZMQ::Context.new
20
+ > s = z.socket(ZMQ::DOWNSTREAM)
21
+ > s.connect("tcp://127.0.0.1:4444")
22
+ > tag = "debug.test"
23
+ > # echo '{"json":"message"}' | fluent-cat debug.test
24
+ > array = ["key" => "value"]
25
+ >
26
+ > def write_impl(s, tag, array)
27
+ > begin
28
+ > s.send([tag, Time.now.to_s, array].to_msgpack)
29
+ > rescue
30
+ > $stderr.puts "write failed: #{$!}"
31
+ > s.close
32
+ > return false
33
+ > end
34
+ >
35
+ > return true
36
+ > end
37
+ >
38
+ > write_impl(s, tag, array)
39
+ 3. Happy logging with zeromq and fluetnd!
40
+
41
+
42
+
43
+ TODO
44
+ ------
45
+ - ZeroMQ output
46
+ - ZeroMQ forwarding
47
+ - JSON support
48
+
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Zmq
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -41,7 +41,7 @@ class ZMQInput < Input
41
41
 
42
42
  def start
43
43
  Signal.trap(:INT){
44
- puts ":INT"
44
+ $log.error "SIGINT occured. shutdown..."
45
45
  @server.close
46
46
  exit(0)
47
47
  }
@@ -96,9 +96,10 @@ class ZMQInput < Input
96
96
  time = Engine.now if time == 0
97
97
  record = msg[2]
98
98
 
99
- p tag
100
- p time
101
- p record
99
+ # for debugging
100
+ #p tag
101
+ #p time
102
+ #p record
102
103
 
103
104
  Engine.emit(tag, time, record)
104
105
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-zmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-30 00:00:00.000000000Z
12
+ date: 2011-10-31 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: zmq plugin for fluent, an event collector
15
15
  email:
@@ -19,8 +19,10 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
+ - AUTHORS
23
+ - COPYING
22
24
  - Gemfile
23
- - README
25
+ - README.md
24
26
  - Rakefile
25
27
  - fluent-plugin-zmq.gemspec
26
28
  - lib/fluent-plugin-zmq/version.rb
data/README DELETED
@@ -1,3 +0,0 @@
1
- Zeromq plugin for Fluent
2
-
3
- exit.