jruby-hornetq 0.4.0 → 0.5.0.alpha
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/Gemfile +9 -0
- data/Gemfile.lock +30 -0
- data/HISTORY.md +6 -0
- data/README.md +33 -35
- data/Rakefile +14 -9
- data/examples/advanced/batch_client.rb +8 -8
- data/examples/advanced/batch_requestor_pattern.rb +34 -34
- data/examples/advanced/bytes_producer.rb +3 -3
- data/examples/advanced/client.rb +5 -5
- data/examples/advanced/client_session_pooling.rb +3 -3
- data/examples/advanced/consume_on_message.rb +5 -5
- data/examples/advanced/consumer.rb +2 -2
- data/examples/advanced/multi_client.rb +3 -3
- data/examples/advanced/producer.rb +3 -3
- data/examples/advanced/server.rb +4 -4
- data/examples/client-server/client.rb +4 -4
- data/examples/client-server/server.rb +4 -4
- data/examples/producer-consumer/consume_all.rb +2 -2
- data/examples/producer-consumer/consume_on_message.rb +5 -5
- data/examples/producer-consumer/consumer.rb +2 -2
- data/examples/producer-consumer/producer.rb +3 -3
- data/examples/resque/hornetq_job.rb +19 -19
- data/examples/resque/processor.rb +4 -4
- data/examples/resque/sleep_job.rb +3 -3
- data/lib/hornetq.rb +3 -2
- data/lib/hornetq/client.rb +4 -2
- data/lib/hornetq/client/connection.rb +86 -86
- data/lib/hornetq/client/message_handler.rb +1 -1
- data/lib/hornetq/client/org_hornetq_api_core_client_client_session.rb +67 -67
- data/lib/hornetq/client/org_hornetq_core_client_impl_client_consumer_impl.rb +11 -11
- data/lib/hornetq/client/org_hornetq_core_client_impl_client_message_impl.rb +126 -126
- data/lib/hornetq/client/org_hornetq_core_client_impl_client_producer_impl.rb +14 -14
- data/lib/hornetq/client/org_hornetq_utils_typed_properties.rb +6 -6
- data/lib/hornetq/client/requestor_pattern.rb +24 -24
- data/lib/hornetq/client/server_pattern.rb +4 -4
- data/lib/hornetq/client/session_pool.rb +18 -18
- data/lib/hornetq/common/logging.rb +1 -14
- data/lib/hornetq/java/hornetq-bootstrap.jar +0 -0
- data/lib/hornetq/java/hornetq-commons.jar +0 -0
- data/lib/hornetq/java/hornetq-core-client.jar +0 -0
- data/lib/hornetq/java/hornetq-journal.jar +0 -0
- data/lib/hornetq/java/hornetq-server.jar +0 -0
- data/lib/hornetq/java/jnp-client.jar +0 -0
- data/lib/hornetq/java/netty.jar +0 -0
- data/lib/hornetq/server.rb +4 -1
- data/lib/hornetq/version.rb +3 -0
- data/nbproject/private/private.properties +4 -0
- data/nbproject/private/private.xml +4 -0
- data/nbproject/private/rake-d.txt +4 -0
- data/nbproject/project.properties +11 -0
- data/nbproject/project.xml +17 -0
- data/test/client_connection_test.rb +25 -25
- data/test/logging_test.rb +3 -3
- metadata +131 -125
- data/bin/data/bindings/hornetq-bindings-1.bindings +0 -0
- data/bin/data/bindings/hornetq-bindings-2.bindings +0 -0
- data/bin/data/journal/hornetq-data-1.hq +0 -0
- data/bin/data/journal/hornetq-data-2.hq +0 -0
- data/lib/hornetq/common/log_delegate.rb +0 -48
- data/lib/hornetq/common/org_hornetq_core_logging_logger.rb +0 -60
- data/lib/hornetq/java/hornetq-core.jar +0 -0
@@ -9,7 +9,7 @@ require 'yaml'
|
|
9
9
|
|
10
10
|
class ClientConnectionTest < Test::Unit::TestCase
|
11
11
|
context 'Client Connection' do
|
12
|
-
|
12
|
+
|
13
13
|
setup do
|
14
14
|
# This test requires a hornetq running local on the default port
|
15
15
|
@config = 'hornetq://localhost'
|
@@ -27,17 +27,17 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
27
27
|
assert_not_nil connection
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
should 'Create and start Connection to the Server with block and start one session' do
|
32
32
|
HornetQ::Client::Connection.session(@config) do |session|
|
33
33
|
assert_not_nil session
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
should 'Start and stop connection' do
|
38
38
|
# Connection is started when created
|
39
39
|
connection = HornetQ::Client::Connection.new(@config)
|
40
|
-
assert_not_nil connection
|
40
|
+
assert_not_nil connection
|
41
41
|
assert_nil connection.close
|
42
42
|
end
|
43
43
|
|
@@ -45,54 +45,54 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
45
45
|
connection = HornetQ::Client::Connection.new(@config)
|
46
46
|
session = connection.create_session
|
47
47
|
assert_not_nil session
|
48
|
-
|
48
|
+
|
49
49
|
assert_nil session.start
|
50
|
-
|
50
|
+
|
51
51
|
assert_equal session.auto_commit_acks?, true
|
52
52
|
assert_equal session.auto_commit_sends?, true
|
53
53
|
assert_equal session.block_on_acknowledge?, false
|
54
54
|
assert_equal session.closed?, false
|
55
55
|
assert_equal session.rollback_only?, false
|
56
56
|
assert_equal session.xa?, false
|
57
|
-
|
57
|
+
|
58
58
|
assert_nil session.stop
|
59
|
-
|
59
|
+
|
60
60
|
# Close the session
|
61
61
|
assert_nil session.close
|
62
62
|
assert_equal session.closed?, true
|
63
|
-
|
63
|
+
|
64
64
|
assert_nil connection.close
|
65
65
|
end
|
66
66
|
|
67
67
|
should 'Create a session with a block' do
|
68
68
|
connection = HornetQ::Client::Connection.new(@config)
|
69
|
-
|
69
|
+
|
70
70
|
connection.session do |session|
|
71
71
|
assert_not_nil session
|
72
72
|
assert_equal session.auto_commit_acks?, true
|
73
73
|
assert_equal session.auto_commit_sends?, true
|
74
74
|
assert_equal session.block_on_acknowledge?, false
|
75
75
|
assert_equal session.rollback_only?, false
|
76
|
-
|
76
|
+
|
77
77
|
assert_equal session.xa?, false
|
78
78
|
assert_equal session.closed?, false
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
assert_nil connection.close
|
82
82
|
end
|
83
83
|
|
84
84
|
should 'create a session without a block and throw exception' do
|
85
85
|
connection = HornetQ::Client::Connection.new(@config)
|
86
|
-
|
86
|
+
|
87
87
|
assert_raise(RuntimeError) { connection.session }
|
88
|
-
|
88
|
+
|
89
89
|
assert_nil connection.close
|
90
90
|
end
|
91
91
|
|
92
92
|
# should 'Create a session from the connection with params' do
|
93
93
|
# connection = HornetQ::Client::Connection.new(@config)
|
94
|
-
#
|
95
|
-
# session_parms = {
|
94
|
+
#
|
95
|
+
# session_parms = {
|
96
96
|
# :transacted => true,
|
97
97
|
# :options => javax.jms.Session::AUTO_ACKNOWLEDGE
|
98
98
|
# }
|
@@ -103,15 +103,15 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
103
103
|
# # When session is transacted, options are ignore, so ack mode must be transacted
|
104
104
|
# assert_equal session.acknowledge_mode, javax.jms.Session::SESSION_TRANSACTED
|
105
105
|
# assert_nil session.close
|
106
|
-
#
|
106
|
+
#
|
107
107
|
# assert_nil connection.stop
|
108
108
|
# assert_nil connection.close
|
109
109
|
# end
|
110
110
|
#
|
111
111
|
# should 'Create a session from the connection with block and params' do
|
112
112
|
# HornetQ::Client::Connection.start_session(@config) do |connection|
|
113
|
-
#
|
114
|
-
# session_parms = {
|
113
|
+
#
|
114
|
+
# session_parms = {
|
115
115
|
# :transacted => true,
|
116
116
|
# :options => javax.jms.Session::CLIENT_ACKNOWLEDGE
|
117
117
|
# }
|
@@ -127,8 +127,8 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
127
127
|
#
|
128
128
|
# should 'Create a session from the connection with block and params opposite test' do
|
129
129
|
# HornetQ::Client::Connection.start_session(@config) do |connection|
|
130
|
-
#
|
131
|
-
# session_parms = {
|
130
|
+
#
|
131
|
+
# session_parms = {
|
132
132
|
# :transacted => false,
|
133
133
|
# :options => javax.jms.Session::AUTO_ACKNOWLEDGE
|
134
134
|
# }
|
@@ -140,9 +140,9 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
140
140
|
# end
|
141
141
|
# end
|
142
142
|
# end
|
143
|
-
#
|
143
|
+
#
|
144
144
|
# context 'HornetQ::Client Connection additional capabilities' do
|
145
|
-
#
|
145
|
+
#
|
146
146
|
# should 'start an on_message handler' do
|
147
147
|
# HornetQ::Client::Connection.start_session(@config) do |connection|
|
148
148
|
# value = nil
|
@@ -151,8 +151,8 @@ class ClientConnectionTest < Test::Unit::TestCase
|
|
151
151
|
# end
|
152
152
|
# end
|
153
153
|
# end
|
154
|
-
#
|
154
|
+
#
|
155
155
|
# end
|
156
|
-
|
156
|
+
|
157
157
|
end
|
158
158
|
end
|
data/test/logging_test.rb
CHANGED
@@ -16,17 +16,17 @@ class LoggingTest < Test::Unit::TestCase
|
|
16
16
|
HornetQ::logger.debug 'Hello'
|
17
17
|
HornetQ::logger.trace 'Hello'
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
should 'be able to use the default HornetQ logger' do
|
21
21
|
# Reset logger to HornetQ logger
|
22
22
|
HornetQ::logger = nil
|
23
23
|
log_it
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
should 'be able to use the default HornetQ Ruby logger' do
|
27
27
|
HornetQ::logger = HornetQ::ruby_logger
|
28
28
|
log_it
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,140 +1,146 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby-hornetq
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: 6
|
5
|
+
version: 0.5.0.alpha
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
9
|
-
|
10
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Reid Morrison
|
9
|
+
- Brad Pardee
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: gene_pool
|
17
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.1.1
|
22
|
+
none: false
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.1.1
|
28
|
+
none: false
|
29
|
+
prerelease: false
|
30
|
+
type: :runtime
|
28
31
|
description: JRuby-HornetQ is a Java and Ruby library that exposes the HornetQ Java API in a ruby friendly way. For JRuby only.
|
29
|
-
email:
|
30
|
-
|
31
|
-
|
32
|
-
executables:
|
33
|
-
|
32
|
+
email:
|
33
|
+
- reidmo@gmail.com
|
34
|
+
- bpardee@gmail.com
|
35
|
+
executables:
|
36
|
+
- hornetq_server
|
34
37
|
extensions: []
|
35
|
-
|
36
38
|
extra_rdoc_files: []
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
39
|
+
files:
|
40
|
+
- Gemfile
|
41
|
+
- Gemfile.lock
|
42
|
+
- HISTORY.md
|
43
|
+
- LICENSE.txt
|
44
|
+
- README.md
|
45
|
+
- Rakefile
|
46
|
+
- bin/hornetq_server
|
47
|
+
- examples/README
|
48
|
+
- examples/advanced/batch_client.rb
|
49
|
+
- examples/advanced/batch_requestor_pattern.rb
|
50
|
+
- examples/advanced/bytes_producer.rb
|
51
|
+
- examples/advanced/client.rb
|
52
|
+
- examples/advanced/client_session_pooling.rb
|
53
|
+
- examples/advanced/consume_on_message.rb
|
54
|
+
- examples/advanced/consumer.rb
|
55
|
+
- examples/advanced/hornetq.yml
|
56
|
+
- examples/advanced/multi_client.rb
|
57
|
+
- examples/advanced/producer.rb
|
58
|
+
- examples/advanced/server.rb
|
59
|
+
- examples/client-server/client.rb
|
60
|
+
- examples/client-server/server.rb
|
61
|
+
- examples/producer-consumer/browse_all.rb
|
62
|
+
- examples/producer-consumer/consume_all.rb
|
63
|
+
- examples/producer-consumer/consume_on_message.rb
|
64
|
+
- examples/producer-consumer/consumer.rb
|
65
|
+
- examples/producer-consumer/producer.rb
|
66
|
+
- examples/resque/hornetq_job.rb
|
67
|
+
- examples/resque/processor.rb
|
68
|
+
- examples/resque/readme.md
|
69
|
+
- examples/resque/resque_conf.rb
|
70
|
+
- examples/resque/resque_worker.rb
|
71
|
+
- examples/resque/sleep_job.rb
|
72
|
+
- examples/server-config/backup_server.yml
|
73
|
+
- examples/server-config/live_server.yml
|
74
|
+
- examples/server-config/standalone_server.yml
|
75
|
+
- examples/simple/invm.rb
|
76
|
+
- examples/transaction-failover/README
|
77
|
+
- examples/transaction-failover/consumer.rb
|
78
|
+
- examples/transaction-failover/hornetq.yml
|
79
|
+
- examples/transaction-failover/producer.rb
|
80
|
+
- examples/worker/README
|
81
|
+
- examples/worker/hornetq.yml
|
82
|
+
- examples/worker/producer.rb
|
83
|
+
- examples/worker/test_object.rb
|
84
|
+
- examples/worker/worker.rb
|
85
|
+
- lib/hornetq.rb
|
86
|
+
- lib/hornetq/client.rb
|
87
|
+
- lib/hornetq/client/connection.rb
|
88
|
+
- lib/hornetq/client/message_handler.rb
|
89
|
+
- lib/hornetq/client/org_hornetq_api_core_client_client_session.rb
|
90
|
+
- lib/hornetq/client/org_hornetq_core_client_impl_client_consumer_impl.rb
|
91
|
+
- lib/hornetq/client/org_hornetq_core_client_impl_client_message_impl.rb
|
92
|
+
- lib/hornetq/client/org_hornetq_core_client_impl_client_producer_impl.rb
|
93
|
+
- lib/hornetq/client/org_hornetq_utils_typed_properties.rb
|
94
|
+
- lib/hornetq/client/requestor_pattern.rb
|
95
|
+
- lib/hornetq/client/server_pattern.rb
|
96
|
+
- lib/hornetq/client/session_pool.rb
|
97
|
+
- lib/hornetq/common/logging.rb
|
98
|
+
- lib/hornetq/java/hornetq-bootstrap.jar
|
99
|
+
- lib/hornetq/java/hornetq-commons.jar
|
100
|
+
- lib/hornetq/java/hornetq-core-client.jar
|
101
|
+
- lib/hornetq/java/hornetq-journal.jar
|
102
|
+
- lib/hornetq/java/hornetq-server.jar
|
103
|
+
- lib/hornetq/java/jnp-client.jar
|
104
|
+
- lib/hornetq/java/netty.jar
|
105
|
+
- lib/hornetq/server.rb
|
106
|
+
- lib/hornetq/server/org_hornetq_core_server_hornet_q_server.rb
|
107
|
+
- lib/hornetq/uri.rb
|
108
|
+
- lib/hornetq/version.rb
|
109
|
+
- nbproject/private/private.properties
|
110
|
+
- nbproject/private/private.xml
|
111
|
+
- nbproject/private/rake-d.txt
|
112
|
+
- nbproject/project.properties
|
113
|
+
- nbproject/project.xml
|
114
|
+
- test/client_connection_test.rb
|
115
|
+
- test/logging_test.rb
|
116
|
+
- test/server_test.rb
|
117
|
+
- test/uri_test.rb
|
112
118
|
homepage: https://github.com/ClarityServices/jruby-hornetq
|
113
|
-
licenses:
|
114
|
-
|
115
|
-
post_install_message:
|
119
|
+
licenses:
|
120
|
+
- Apache License V2.0
|
121
|
+
post_install_message:
|
116
122
|
rdoc_options: []
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
hash: 2
|
121
133
|
none: false
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>'
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.3.1
|
127
139
|
none: false
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: "0"
|
132
140
|
requirements: []
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
signing_key:
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 1.8.24
|
143
|
+
signing_key:
|
137
144
|
specification_version: 3
|
138
145
|
summary: JRuby interface into HornetQ
|
139
146
|
test_files: []
|
140
|
-
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module HornetQ
|
2
|
-
# Internal use only class for delegating HornetQ logging into the Rails or Ruby
|
3
|
-
# loggers
|
4
|
-
#
|
5
|
-
private
|
6
|
-
|
7
|
-
# HornetQ requires a connection from which it can create a logger per thread and/or class
|
8
|
-
class LogDelegateFactory
|
9
|
-
include Java::org.hornetq.spi.core.logging::LogDelegateFactory
|
10
|
-
|
11
|
-
def createDelegate(klass)
|
12
|
-
LogDelegate.new(klass.name)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
# Delegate HornetQ log calls to Rails, Ruby or custom logger
|
17
|
-
class LogDelegate
|
18
|
-
include Java::org.hornetq.spi.core.logging::LogDelegate
|
19
|
-
|
20
|
-
# TODO: Carry class_name over into logging entries depending on implementation
|
21
|
-
def initialize(class_name)
|
22
|
-
@class_name = class_name
|
23
|
-
end
|
24
|
-
|
25
|
-
# DRY, generate a method for each required log level
|
26
|
-
['debug', 'error', 'fatal', 'info', 'trace', 'warn'].each do |level|
|
27
|
-
eval <<LOG_LEVEL_METHOD
|
28
|
-
def #{level}(message, t=nil)
|
29
|
-
logger = HornetQ::logger
|
30
|
-
if logger.#{level}?
|
31
|
-
if t
|
32
|
-
logger.#{level}("[\#{@class_name}] \#{message}. \#{t.toString}")
|
33
|
-
logger.#{level}(t.stack_trace.toString)
|
34
|
-
else
|
35
|
-
logger.#{level}{"[\#{@class_name}] \#{message}"}
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def is#{level.capitalize}Enabled
|
41
|
-
HornetQ::logger.#{level}?
|
42
|
-
end
|
43
|
-
|
44
|
-
LOG_LEVEL_METHOD
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|