jruby-hornetq 0.4.0 → 0.5.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/Gemfile +9 -0
  2. data/Gemfile.lock +30 -0
  3. data/HISTORY.md +6 -0
  4. data/README.md +33 -35
  5. data/Rakefile +14 -9
  6. data/examples/advanced/batch_client.rb +8 -8
  7. data/examples/advanced/batch_requestor_pattern.rb +34 -34
  8. data/examples/advanced/bytes_producer.rb +3 -3
  9. data/examples/advanced/client.rb +5 -5
  10. data/examples/advanced/client_session_pooling.rb +3 -3
  11. data/examples/advanced/consume_on_message.rb +5 -5
  12. data/examples/advanced/consumer.rb +2 -2
  13. data/examples/advanced/multi_client.rb +3 -3
  14. data/examples/advanced/producer.rb +3 -3
  15. data/examples/advanced/server.rb +4 -4
  16. data/examples/client-server/client.rb +4 -4
  17. data/examples/client-server/server.rb +4 -4
  18. data/examples/producer-consumer/consume_all.rb +2 -2
  19. data/examples/producer-consumer/consume_on_message.rb +5 -5
  20. data/examples/producer-consumer/consumer.rb +2 -2
  21. data/examples/producer-consumer/producer.rb +3 -3
  22. data/examples/resque/hornetq_job.rb +19 -19
  23. data/examples/resque/processor.rb +4 -4
  24. data/examples/resque/sleep_job.rb +3 -3
  25. data/lib/hornetq.rb +3 -2
  26. data/lib/hornetq/client.rb +4 -2
  27. data/lib/hornetq/client/connection.rb +86 -86
  28. data/lib/hornetq/client/message_handler.rb +1 -1
  29. data/lib/hornetq/client/org_hornetq_api_core_client_client_session.rb +67 -67
  30. data/lib/hornetq/client/org_hornetq_core_client_impl_client_consumer_impl.rb +11 -11
  31. data/lib/hornetq/client/org_hornetq_core_client_impl_client_message_impl.rb +126 -126
  32. data/lib/hornetq/client/org_hornetq_core_client_impl_client_producer_impl.rb +14 -14
  33. data/lib/hornetq/client/org_hornetq_utils_typed_properties.rb +6 -6
  34. data/lib/hornetq/client/requestor_pattern.rb +24 -24
  35. data/lib/hornetq/client/server_pattern.rb +4 -4
  36. data/lib/hornetq/client/session_pool.rb +18 -18
  37. data/lib/hornetq/common/logging.rb +1 -14
  38. data/lib/hornetq/java/hornetq-bootstrap.jar +0 -0
  39. data/lib/hornetq/java/hornetq-commons.jar +0 -0
  40. data/lib/hornetq/java/hornetq-core-client.jar +0 -0
  41. data/lib/hornetq/java/hornetq-journal.jar +0 -0
  42. data/lib/hornetq/java/hornetq-server.jar +0 -0
  43. data/lib/hornetq/java/jnp-client.jar +0 -0
  44. data/lib/hornetq/java/netty.jar +0 -0
  45. data/lib/hornetq/server.rb +4 -1
  46. data/lib/hornetq/version.rb +3 -0
  47. data/nbproject/private/private.properties +4 -0
  48. data/nbproject/private/private.xml +4 -0
  49. data/nbproject/private/rake-d.txt +4 -0
  50. data/nbproject/project.properties +11 -0
  51. data/nbproject/project.xml +17 -0
  52. data/test/client_connection_test.rb +25 -25
  53. data/test/logging_test.rb +3 -3
  54. metadata +131 -125
  55. data/bin/data/bindings/hornetq-bindings-1.bindings +0 -0
  56. data/bin/data/bindings/hornetq-bindings-2.bindings +0 -0
  57. data/bin/data/journal/hornetq-data-1.hq +0 -0
  58. data/bin/data/journal/hornetq-data-2.hq +0 -0
  59. data/lib/hornetq/common/log_delegate.rb +0 -48
  60. data/lib/hornetq/common/org_hornetq_core_logging_logger.rb +0 -60
  61. 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.4.0
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: 6
5
+ version: 0.5.0.alpha
6
6
  platform: ruby
7
- authors:
8
- - Reid Morrison
9
- - Brad Pardee
10
- autorequire:
7
+ authors:
8
+ - Reid Morrison
9
+ - Brad Pardee
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-04-01 00:00:00 -04:00
15
- default_executable:
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: gene_pool
19
- prerelease: false
20
- requirement: &id001 !ruby/object:Gem::Requirement
21
- none: false
22
- requirements:
23
- - - ~>
24
- - !ruby/object:Gem::Version
25
- version: 1.1.1
26
- type: :runtime
27
- version_requirements: *id001
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
- - rubywmq@gmail.com
31
- - bpardee@gmail.com
32
- executables:
33
- - hornetq_server
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
- files:
39
- - HISTORY.md
40
- - LICENSE.txt
41
- - Rakefile
42
- - README.md
43
- - bin/hornetq_server
44
- - bin/data/bindings/hornetq-bindings-1.bindings
45
- - bin/data/bindings/hornetq-bindings-2.bindings
46
- - bin/data/journal/hornetq-data-1.hq
47
- - bin/data/journal/hornetq-data-2.hq
48
- - examples/README
49
- - examples/advanced/batch_client.rb
50
- - examples/advanced/batch_requestor_pattern.rb
51
- - examples/advanced/bytes_producer.rb
52
- - examples/advanced/client.rb
53
- - examples/advanced/client_session_pooling.rb
54
- - examples/advanced/consume_on_message.rb
55
- - examples/advanced/consumer.rb
56
- - examples/advanced/hornetq.yml
57
- - examples/advanced/multi_client.rb
58
- - examples/advanced/producer.rb
59
- - examples/advanced/server.rb
60
- - examples/client-server/client.rb
61
- - examples/client-server/server.rb
62
- - examples/producer-consumer/browse_all.rb
63
- - examples/producer-consumer/consume_all.rb
64
- - examples/producer-consumer/consume_on_message.rb
65
- - examples/producer-consumer/consumer.rb
66
- - examples/producer-consumer/producer.rb
67
- - examples/resque/hornetq_job.rb
68
- - examples/resque/processor.rb
69
- - examples/resque/readme.md
70
- - examples/resque/resque_conf.rb
71
- - examples/resque/resque_worker.rb
72
- - examples/resque/sleep_job.rb
73
- - examples/server-config/backup_server.yml
74
- - examples/server-config/live_server.yml
75
- - examples/server-config/standalone_server.yml
76
- - examples/simple/invm.rb
77
- - examples/transaction-failover/consumer.rb
78
- - examples/transaction-failover/hornetq.yml
79
- - examples/transaction-failover/producer.rb
80
- - examples/transaction-failover/README
81
- - examples/worker/hornetq.yml
82
- - examples/worker/producer.rb
83
- - examples/worker/README
84
- - examples/worker/test_object.rb
85
- - examples/worker/worker.rb
86
- - lib/hornetq.rb
87
- - lib/hornetq/client.rb
88
- - lib/hornetq/server.rb
89
- - lib/hornetq/uri.rb
90
- - lib/hornetq/client/connection.rb
91
- - lib/hornetq/client/message_handler.rb
92
- - lib/hornetq/client/org_hornetq_api_core_client_client_session.rb
93
- - lib/hornetq/client/org_hornetq_core_client_impl_client_consumer_impl.rb
94
- - lib/hornetq/client/org_hornetq_core_client_impl_client_message_impl.rb
95
- - lib/hornetq/client/org_hornetq_core_client_impl_client_producer_impl.rb
96
- - lib/hornetq/client/org_hornetq_utils_typed_properties.rb
97
- - lib/hornetq/client/requestor_pattern.rb
98
- - lib/hornetq/client/server_pattern.rb
99
- - lib/hornetq/client/session_pool.rb
100
- - lib/hornetq/common/log_delegate.rb
101
- - lib/hornetq/common/logging.rb
102
- - lib/hornetq/common/org_hornetq_core_logging_logger.rb
103
- - lib/hornetq/java/hornetq-core-client.jar
104
- - lib/hornetq/java/hornetq-core.jar
105
- - lib/hornetq/java/netty.jar
106
- - lib/hornetq/server/org_hornetq_core_server_hornet_q_server.rb
107
- - test/client_connection_test.rb
108
- - test/logging_test.rb
109
- - test/server_test.rb
110
- - test/uri_test.rb
111
- has_rdoc: true
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
- require_paths:
119
- - lib
120
- required_ruby_version: !ruby/object:Gem::Requirement
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
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: "0"
126
- required_rubygems_version: !ruby/object:Gem::Requirement
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
- rubyforge_project:
135
- rubygems_version: 1.5.1
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
@@ -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