torquebox-messaging 2.0.0.cr1-java → 2.0.0-java

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.
Binary file
@@ -1,14 +1,14 @@
1
1
  module TorqueboxMessaging
2
- VERSION = '2.0.0.cr1'
3
- MAVEN_VERSION = '2.0.0.cr1'
2
+ VERSION = '2.0.0'
3
+ MAVEN_VERSION = '2.0.0'
4
4
  end
5
5
  begin
6
6
  require 'java'
7
7
  require File.dirname(__FILE__) + '/torquebox-messaging.jar'
8
8
  require File.dirname(__FILE__) + '/jboss-jms-api_1.1_spec-1.0.0.Final.jar'
9
9
  require File.dirname(__FILE__) + '/jboss-transaction-api_1.1_spec-1.0.0.Final.jar'
10
- require File.dirname(__FILE__) + '/hornetq-core-2.2.11.Final.jar'
11
- require File.dirname(__FILE__) + '/hornetq-jms-2.2.11.Final.jar'
10
+ require File.dirname(__FILE__) + '/hornetq-core-2.2.13.Final.jar'
11
+ require File.dirname(__FILE__) + '/hornetq-jms-2.2.13.Final.jar'
12
12
  require File.dirname(__FILE__) + '/netty-3.2.6.Final.jar'
13
13
  rescue LoadError
14
14
  puts 'JAR-based gems require JRuby to load. Please visit www.jruby.org.'
@@ -27,6 +27,14 @@ module TorqueBox
27
27
  # Backgroundable provides mechanism for executing an object's
28
28
  # methods asynchronously.
29
29
  module Backgroundable
30
+ NEWRELIC_AVAILABLE ||=
31
+ begin
32
+ require 'newrelic_rpm'
33
+ true
34
+ rescue LoadError
35
+ false
36
+ end
37
+
30
38
  def self.included(base)
31
39
  base.extend(ClassMethods)
32
40
  base.send(:include, FutureStatus)
@@ -96,6 +104,7 @@ module TorqueBox
96
104
  if privatize || protect
97
105
  send((privatize ? :private : :protected), method, sync_method, async_method)
98
106
  end
107
+
99
108
  end
100
109
  ensure
101
110
  @__backgroundable_methods[method][:backgrounding] = nil
@@ -22,11 +22,28 @@ require 'torquebox/messaging/future_responder'
22
22
  module TorqueBox
23
23
  module Messaging
24
24
  class BackgroundableProcessor < MessageProcessor
25
+
25
26
  def on_message(hash)
26
27
  FutureResponder.new( Queue.new( hash[:future_queue] ), hash[:future_id] ).respond do
28
+ # TORQUE-741 allow always_background methods to report as background tasks in NewRelic
29
+ begin
30
+ if TorqueBox::Messaging::Backgroundable::NEWRELIC_AVAILABLE
31
+ class << hash[:receiver]
32
+ include NewRelic::Agent::Instrumentation::ControllerInstrumentation
33
+ add_transaction_tracer hash[:method], :name => hash[:method].sub("__sync_", ""), :category => :task
34
+ end
35
+ end
36
+ rescue
37
+ log.error "Error loading New Relic for backgrouded process #{hash[:method]}"
38
+ end
27
39
  hash[:receiver].send(hash[:method], *hash[:args])
28
40
  end
29
41
  end
42
+
43
+ private
44
+ def log
45
+ @logger ||= TorqueBox::Logger.new(self.class)
46
+ end
30
47
  end
31
48
  end
32
49
  end
@@ -55,6 +55,7 @@ describe TorqueBox::Messaging::Backgroundable do
55
55
  @util.protected_instance_methods_include?(MyTestModel, '__async_some_peeking').should be_true
56
56
  @util.protected_instance_methods_include?(MyTestModel, '__sync_some_peeking').should be_true
57
57
  end
58
+
58
59
  end
59
60
 
60
61
  describe "a method handled asynchronously" do
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torquebox-messaging
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 2.0.0.cr1
4
+ prerelease:
5
+ version: 2.0.0
6
6
  platform: java
7
7
  authors:
8
8
  - The TorqueBox Team
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-03-02 00:00:00 Z
13
+ date: 2012-03-31 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: torquebox-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.0.cr1
23
+ version: 2.0.0
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - "="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.0.0.cr1
34
+ version: 2.0.0
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
@@ -56,6 +56,17 @@ dependencies:
56
56
  version: 2.7.0
57
57
  type: :development
58
58
  version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: newrelic_rpm
61
+ prerelease: false
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - "="
66
+ - !ruby/object:Gem::Version
67
+ version: 3.3.2
68
+ type: :development
69
+ version_requirements: *id005
59
70
  description: ""
60
71
  email:
61
72
  - torquebox-dev@torquebox.org
@@ -71,49 +82,49 @@ files:
71
82
  - lib/torquebox-messaging.rb
72
83
  - lib/jboss-jms-api_1.1_spec-1.0.0.Final.jar
73
84
  - lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
74
- - lib/hornetq-core-2.2.11.Final.jar
75
- - lib/hornetq-jms-2.2.11.Final.jar
85
+ - lib/hornetq-core-2.2.13.Final.jar
86
+ - lib/hornetq-jms-2.2.13.Final.jar
76
87
  - lib/netty-3.2.6.Final.jar
77
88
  - lib/org.torquebox.messaging-client.rb
78
89
  - lib/gem_hook.rb
79
90
  - lib/torquebox/messaging.rb
80
- - lib/torquebox/messaging/const_missing.rb
81
- - lib/torquebox/messaging/session.rb
82
- - lib/torquebox/messaging/queue.rb
83
- - lib/torquebox/messaging/message.rb
84
- - lib/torquebox/messaging/destination.rb
85
- - lib/torquebox/messaging/backgroundable.rb
86
- - lib/torquebox/messaging/message_processor.rb
91
+ - lib/torquebox/messaging/core.rb
92
+ - lib/torquebox/messaging/marshal_message.rb
93
+ - lib/torquebox/messaging/future_status.rb
87
94
  - lib/torquebox/messaging/text_message.rb
88
- - lib/torquebox/messaging/connection.rb
95
+ - lib/torquebox/messaging/marshal_base64_message.rb
89
96
  - lib/torquebox/messaging/task.rb
90
- - lib/torquebox/messaging/json_message.rb
97
+ - lib/torquebox/messaging/xa_connection_factory.rb
98
+ - lib/torquebox/messaging/queue.rb
99
+ - lib/torquebox/messaging/clojure_message.rb
100
+ - lib/torquebox/messaging/backgroundable_processor.rb
91
101
  - lib/torquebox/messaging/xa_session.rb
102
+ - lib/torquebox/messaging/connection.rb
103
+ - lib/torquebox/messaging/future.rb
104
+ - lib/torquebox/messaging/message.rb
105
+ - lib/torquebox/messaging/topic.rb
106
+ - lib/torquebox/messaging/const_missing.rb
107
+ - lib/torquebox/messaging/json_message.rb
108
+ - lib/torquebox/messaging/connection_factory.rb
109
+ - lib/torquebox/messaging/backgroundable.rb
92
110
  - lib/torquebox/messaging/processor_wrapper.rb
93
- - lib/torquebox/messaging/future_status.rb
94
- - lib/torquebox/messaging/backgroundable_processor.rb
95
- - lib/torquebox/messaging/marshal_message.rb
96
111
  - lib/torquebox/messaging/future_responder.rb
97
- - lib/torquebox/messaging/clojure_message.rb
98
- - lib/torquebox/messaging/datamapper_marshaling.rb
99
- - lib/torquebox/messaging/xa_connection_factory.rb
100
- - lib/torquebox/messaging/connection_factory.rb
101
- - lib/torquebox/messaging/marshal_base64_message.rb
102
- - lib/torquebox/messaging/core.rb
103
- - lib/torquebox/messaging/topic.rb
112
+ - lib/torquebox/messaging/session.rb
113
+ - lib/torquebox/messaging/message_processor.rb
104
114
  - lib/torquebox/messaging/xa_connection.rb
105
- - lib/torquebox/messaging/future.rb
115
+ - lib/torquebox/messaging/datamapper_marshaling.rb
116
+ - lib/torquebox/messaging/destination.rb
106
117
  - lib/torquebox/messaging/ext/javax_jms_queue_browser.rb
107
- - spec/message_spec.rb
118
+ - spec/future_responder_spec.rb
108
119
  - spec/backgroundable_spec.rb
109
- - spec/destination_spec.rb
110
- - spec/future_spec.rb
111
120
  - spec/task_spec.rb
112
- - spec/json_message_spec.rb
113
- - spec/future_responder_spec.rb
121
+ - spec/future_spec.rb
114
122
  - spec/datamapper_marshaling_spec.rb
123
+ - spec/message_spec.rb
115
124
  - spec/message_processor_spec.rb
116
- homepage: http://www.torquebox.org/torquebox-gems-parent/torquebox-messaging/
125
+ - spec/json_message_spec.rb
126
+ - spec/destination_spec.rb
127
+ homepage: http://torquebox.org/
117
128
  licenses:
118
129
  - lgpl
119
130
  post_install_message:
@@ -130,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
141
  required_rubygems_version: !ruby/object:Gem::Requirement
131
142
  none: false
132
143
  requirements:
133
- - - ">"
144
+ - - ">="
134
145
  - !ruby/object:Gem::Version
135
- version: 1.3.1
146
+ version: "0"
136
147
  requirements: []
137
148
 
138
149
  rubyforge_project:
@@ -141,12 +152,12 @@ signing_key:
141
152
  specification_version: 3
142
153
  summary: TorqueBox Messaging Client
143
154
  test_files:
144
- - spec/message_spec.rb
155
+ - spec/future_responder_spec.rb
145
156
  - spec/backgroundable_spec.rb
146
- - spec/destination_spec.rb
147
- - spec/future_spec.rb
148
157
  - spec/task_spec.rb
149
- - spec/json_message_spec.rb
150
- - spec/future_responder_spec.rb
158
+ - spec/future_spec.rb
151
159
  - spec/datamapper_marshaling_spec.rb
160
+ - spec/message_spec.rb
152
161
  - spec/message_processor_spec.rb
162
+ - spec/json_message_spec.rb
163
+ - spec/destination_spec.rb