stomp 1.1.10 → 1.2.0
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/CHANGELOG.rdoc +17 -0
- data/README.rdoc +11 -3
- data/Rakefile +2 -2
- data/bin/catstomp +3 -3
- data/examples/client11_ex1.rb +78 -0
- data/examples/client11_putget1.rb +57 -0
- data/examples/conn11_ex1.rb +101 -0
- data/examples/conn11_ex2.rb +75 -0
- data/examples/conn11_hb1.rb +46 -0
- data/examples/consumer.rb +2 -0
- data/examples/get11conn_ex1.rb +107 -0
- data/examples/get11conn_ex2.rb +67 -0
- data/examples/logexamp.rb +18 -2
- data/examples/publisher.rb +2 -0
- data/examples/put11conn_ex1.rb +43 -0
- data/examples/putget11_rh1.rb +81 -0
- data/examples/slogger.rb +79 -1
- data/examples/stomp11_common.rb +45 -0
- data/examples/topic_consumer.rb +19 -0
- data/examples/topic_publisher.rb +15 -0
- data/lib/stomp.rb +4 -0
- data/lib/stomp/client.rb +36 -4
- data/lib/stomp/codec.rb +41 -0
- data/lib/stomp/connection.rb +623 -29
- data/lib/stomp/constants.rb +78 -0
- data/lib/stomp/errors.rb +60 -2
- data/lib/stomp/ext/hash.rb +3 -1
- data/lib/stomp/message.rb +32 -3
- data/lib/stomp/version.rb +4 -2
- data/spec/client_shared_examples.rb +2 -0
- data/spec/client_spec.rb +2 -0
- data/spec/connection_spec.rb +30 -9
- data/spec/message_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- data/stomp.gemspec +25 -24
- data/test/test_client.rb +152 -44
- data/test/test_codec.rb +83 -0
- data/test/test_connection.rb +138 -25
- data/test/test_connection1p.rb +251 -0
- data/test/test_helper.rb +48 -0
- data/test/test_message.rb +69 -19
- data/test/tlogger.rb +155 -0
- metadata +52 -69
data/test/tlogger.rb
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
Callback logger for tests.
|
6
|
+
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'logger' # use the standard Ruby logger .....
|
10
|
+
|
11
|
+
class Tlogger
|
12
|
+
#
|
13
|
+
def initialize(init_parms = nil)
|
14
|
+
@log = Logger::new(STDOUT) # User preference
|
15
|
+
@log.level = Logger::DEBUG # User preference
|
16
|
+
@log.info("Logger initialization complete.")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Log connecting events
|
20
|
+
def on_connecting(parms)
|
21
|
+
begin
|
22
|
+
@log.debug "Connecting: #{info(parms)}"
|
23
|
+
rescue
|
24
|
+
@log.debug "Connecting oops"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Log connected events
|
29
|
+
def on_connected(parms)
|
30
|
+
begin
|
31
|
+
@log.debug "Connected: #{info(parms)}"
|
32
|
+
rescue
|
33
|
+
@log.debug "Connected oops"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Log connectfail events
|
38
|
+
def on_connectfail(parms)
|
39
|
+
begin
|
40
|
+
@log.debug "Connect Fail #{info(parms)}"
|
41
|
+
rescue
|
42
|
+
@log.debug "Connect Fail oops"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Log disconnect events
|
47
|
+
def on_disconnect(parms)
|
48
|
+
begin
|
49
|
+
@log.debug "Disconnected #{info(parms)}"
|
50
|
+
rescue
|
51
|
+
@log.debug "Disconnected oops"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Log miscellaneous errors
|
56
|
+
def on_miscerr(parms, errstr)
|
57
|
+
begin
|
58
|
+
@log.debug "Miscellaneous Error #{info(parms)}"
|
59
|
+
@log.debug "Miscellaneous Error String #{errstr}"
|
60
|
+
rescue
|
61
|
+
@log.debug "Miscellaneous Error oops"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Subscribe
|
66
|
+
def on_subscribe(parms, headers)
|
67
|
+
begin
|
68
|
+
@log.debug "Subscribe Parms #{info(parms)}"
|
69
|
+
@log.debug "Subscribe Headers #{headers}"
|
70
|
+
rescue
|
71
|
+
@log.debug "Subscribe oops"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Publish
|
76
|
+
def on_publish(parms, message, headers)
|
77
|
+
begin
|
78
|
+
@log.debug "Publish Parms #{info(parms)}"
|
79
|
+
@log.debug "Publish Message #{message}"
|
80
|
+
@log.debug "Publish Headers #{headers}"
|
81
|
+
rescue
|
82
|
+
@log.debug "Publish oops"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Receive
|
87
|
+
def on_receive(parms, result)
|
88
|
+
begin
|
89
|
+
@log.debug "Receive Parms #{info(parms)}"
|
90
|
+
@log.debug "Receive Result #{result}"
|
91
|
+
rescue
|
92
|
+
@log.debug "Receive oops"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Stomp 1.1+ - heart beat read (receive) failed
|
97
|
+
def on_hbread_fail(parms, ticker_data)
|
98
|
+
begin
|
99
|
+
@log.debug "Hbreadf Parms #{info(parms)}"
|
100
|
+
@log.debug "Hbreadf Result #{ticker_data}"
|
101
|
+
rescue
|
102
|
+
@log.debug "Hbreadf oops"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
# Stomp 1.1+ - heart beat send (transmit) failed
|
107
|
+
def on_hbwrite_fail(parms, ticker_data)
|
108
|
+
begin
|
109
|
+
@log.debug "Hbwritef Parms #{info(parms)}"
|
110
|
+
@log.debug "Hbwritef Result #{ticker_data}"
|
111
|
+
rescue
|
112
|
+
@log.debug "Hbwritef oops"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
# Stomp 1.1+ - heart beat read (receive) failed
|
118
|
+
def on_hbread_fail(parms, ticker_data)
|
119
|
+
begin
|
120
|
+
@log.debug "Hbreadf Parms #{info(parms)}"
|
121
|
+
@log.debug "Hbreadf Result #{ticker_data}"
|
122
|
+
rescue
|
123
|
+
@log.debug "Hbreadf oops"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Stomp 1.1+ - heart beat thread fires
|
128
|
+
def on_hbfire(parms, type, time)
|
129
|
+
begin
|
130
|
+
@log.debug "HBfire #{type} " + "=" * 30
|
131
|
+
@log.debug "HBfire #{type} Parms #{info(parms)}"
|
132
|
+
@log.debug "HBfire #{type} Time #{time}"
|
133
|
+
rescue
|
134
|
+
@log.debug "HBfire #{type} oops"
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
private
|
139
|
+
|
140
|
+
def info(parms)
|
141
|
+
#
|
142
|
+
# Available in the Hash:
|
143
|
+
# parms[:cur_host]
|
144
|
+
# parms[:cur_port]
|
145
|
+
# parms[:cur_login]
|
146
|
+
# parms[:cur_passcode]
|
147
|
+
# parms[:cur_ssl]
|
148
|
+
# parms[:cur_recondelay]
|
149
|
+
# parms[:cur_parseto]
|
150
|
+
# parms[:cur_conattempts]
|
151
|
+
#
|
152
|
+
"Host: #{parms[:cur_host]}, Port: #{parms[:cur_port]}, Login: Port: #{parms[:cur_login]}, Passcode: #{parms[:cur_passcode]}"
|
153
|
+
end
|
154
|
+
end # of class
|
155
|
+
|
metadata
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: stomp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 10
|
10
|
-
version: 1.1.10
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Brian McCallister
|
14
9
|
- Marius Mathiesen
|
15
10
|
- Thiago Morello
|
@@ -17,53 +12,61 @@ authors:
|
|
17
12
|
autorequire:
|
18
13
|
bindir: bin
|
19
14
|
cert_chain: []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
dependencies:
|
24
|
-
- !ruby/object:Gem::Dependency
|
15
|
+
date: 2011-12-15 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
25
18
|
name: rspec
|
26
|
-
|
27
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
requirement: &14851600 !ruby/object:Gem::Requirement
|
28
20
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
33
|
-
segments:
|
34
|
-
- 2
|
35
|
-
- 3
|
36
|
-
version: "2.3"
|
21
|
+
requirements:
|
22
|
+
- - ! '>='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '2.3'
|
37
25
|
type: :development
|
38
|
-
|
39
|
-
|
40
|
-
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: *14851600
|
28
|
+
description: Ruby client for the Stomp messaging protocol. Note that this gem is
|
29
|
+
no longer supported on rubyforge.
|
30
|
+
email:
|
41
31
|
- brianm@apache.org
|
42
32
|
- marius@stones.com
|
43
33
|
- morellon@gmail.com
|
44
34
|
- allard.guy.m@gmail.com
|
45
|
-
executables:
|
35
|
+
executables:
|
46
36
|
- catstomp
|
47
37
|
- stompcat
|
48
38
|
extensions: []
|
49
|
-
|
50
|
-
extra_rdoc_files:
|
39
|
+
extra_rdoc_files:
|
51
40
|
- LICENSE
|
52
41
|
- README.rdoc
|
53
|
-
files:
|
42
|
+
files:
|
54
43
|
- CHANGELOG.rdoc
|
55
44
|
- LICENSE
|
56
45
|
- README.rdoc
|
57
46
|
- Rakefile
|
58
47
|
- bin/catstomp
|
59
48
|
- bin/stompcat
|
49
|
+
- examples/client11_ex1.rb
|
50
|
+
- examples/client11_putget1.rb
|
51
|
+
- examples/conn11_ex1.rb
|
52
|
+
- examples/conn11_ex2.rb
|
53
|
+
- examples/conn11_hb1.rb
|
60
54
|
- examples/consumer.rb
|
55
|
+
- examples/get11conn_ex1.rb
|
56
|
+
- examples/get11conn_ex2.rb
|
61
57
|
- examples/logexamp.rb
|
62
58
|
- examples/publisher.rb
|
59
|
+
- examples/put11conn_ex1.rb
|
60
|
+
- examples/putget11_rh1.rb
|
63
61
|
- examples/slogger.rb
|
62
|
+
- examples/stomp11_common.rb
|
63
|
+
- examples/topic_consumer.rb
|
64
|
+
- examples/topic_publisher.rb
|
64
65
|
- lib/stomp.rb
|
65
66
|
- lib/stomp/client.rb
|
67
|
+
- lib/stomp/codec.rb
|
66
68
|
- lib/stomp/connection.rb
|
69
|
+
- lib/stomp/constants.rb
|
67
70
|
- lib/stomp/errors.rb
|
68
71
|
- lib/stomp/ext/hash.rb
|
69
72
|
- lib/stomp/message.rb
|
@@ -75,54 +78,34 @@ files:
|
|
75
78
|
- spec/spec_helper.rb
|
76
79
|
- stomp.gemspec
|
77
80
|
- test/test_client.rb
|
81
|
+
- test/test_codec.rb
|
78
82
|
- test/test_connection.rb
|
83
|
+
- test/test_connection1p.rb
|
79
84
|
- test/test_helper.rb
|
80
85
|
- test/test_message.rb
|
81
|
-
|
82
|
-
homepage: https://
|
86
|
+
- test/tlogger.rb
|
87
|
+
homepage: https://github.com/morellon/stomp
|
83
88
|
licenses: []
|
84
|
-
|
85
89
|
post_install_message:
|
86
90
|
rdoc_options: []
|
87
|
-
|
88
|
-
require_paths:
|
91
|
+
require_paths:
|
89
92
|
- lib
|
90
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
94
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
|
97
|
-
- 0
|
98
|
-
version: "0"
|
99
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
segments:
|
106
|
-
- 0
|
107
|
-
version: "0"
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
108
105
|
requirements: []
|
109
|
-
|
110
106
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.
|
107
|
+
rubygems_version: 1.8.11
|
112
108
|
signing_key:
|
113
109
|
specification_version: 3
|
114
110
|
summary: Ruby client for the Stomp messaging protocol
|
115
|
-
test_files:
|
116
|
-
- examples/consumer.rb
|
117
|
-
- examples/logexamp.rb
|
118
|
-
- examples/publisher.rb
|
119
|
-
- examples/slogger.rb
|
120
|
-
- spec/client_shared_examples.rb
|
121
|
-
- spec/client_spec.rb
|
122
|
-
- spec/connection_spec.rb
|
123
|
-
- spec/message_spec.rb
|
124
|
-
- spec/spec_helper.rb
|
125
|
-
- test/test_client.rb
|
126
|
-
- test/test_connection.rb
|
127
|
-
- test/test_helper.rb
|
128
|
-
- test/test_message.rb
|
111
|
+
test_files: []
|