torquebox-messaging 2.0.1-java → 2.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,6 +1,6 @@
1
1
  module TorqueboxMessaging
2
- VERSION = '2.0.1'
3
- MAVEN_VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
+ MAVEN_VERSION = '2.0.2'
4
4
  end
5
5
  begin
6
6
  require 'java'
@@ -27,13 +27,6 @@ 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
31
  def self.included(base)
39
32
  base.extend(ClassMethods)
@@ -83,6 +76,18 @@ module TorqueBox
83
76
  end
84
77
  end
85
78
 
79
+ def __enable_backgroundable_newrelic_tracing(method)
80
+ if defined?(NewRelic::Agent)
81
+ include(NewRelic::Agent::Instrumentation::ControllerInstrumentation) unless
82
+ include?(NewRelic::Agent::Instrumentation::ControllerInstrumentation)
83
+ begin
84
+ add_transaction_tracer(method, :name => method.sub("__sync_", ""), :category => :task)
85
+ rescue Exception => e
86
+ log.error "Error loading New Relic for backgrounded method #{method.sub("__sync_", "")}: #{e}"
87
+ end
88
+ end
89
+ end
90
+
86
91
  private
87
92
  def __enable_backgrounding(method)
88
93
  privatize = Util.private_instance_methods_include?(self, method)
@@ -25,17 +25,7 @@ module TorqueBox
25
25
 
26
26
  def on_message(hash)
27
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
28
+ hash[:receiver].class.__enable_backgroundable_newrelic_tracing(hash[:method])
39
29
  hash[:receiver].send(hash[:method], *hash[:args])
40
30
  end
41
31
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-messaging
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.1
5
+ version: 2.0.2
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-04-16 00:00:00 Z
13
+ date: 2012-05-01 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.1
23
+ version: 2.0.2
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.1
34
+ version: 2.0.2
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
@@ -88,41 +88,41 @@ files:
88
88
  - lib/gem_hook.rb
89
89
  - lib/org.torquebox.messaging-client.rb
90
90
  - lib/torquebox/messaging.rb
91
- - lib/torquebox/messaging/connection.rb
92
- - lib/torquebox/messaging/topic.rb
93
- - lib/torquebox/messaging/clojure_message.rb
94
- - lib/torquebox/messaging/message.rb
95
- - lib/torquebox/messaging/session.rb
96
- - lib/torquebox/messaging/core.rb
97
- - lib/torquebox/messaging/text_message.rb
98
- - lib/torquebox/messaging/json_message.rb
99
- - lib/torquebox/messaging/backgroundable_processor.rb
91
+ - lib/torquebox/messaging/queue.rb
100
92
  - lib/torquebox/messaging/xa_connection.rb
101
- - lib/torquebox/messaging/xa_connection_factory.rb
102
- - lib/torquebox/messaging/xa_session.rb
103
93
  - lib/torquebox/messaging/const_missing.rb
104
- - lib/torquebox/messaging/queue.rb
105
- - lib/torquebox/messaging/destination.rb
106
- - lib/torquebox/messaging/marshal_base64_message.rb
107
94
  - lib/torquebox/messaging/processor_wrapper.rb
108
- - lib/torquebox/messaging/marshal_message.rb
95
+ - lib/torquebox/messaging/destination.rb
109
96
  - lib/torquebox/messaging/future.rb
110
- - lib/torquebox/messaging/task.rb
111
- - lib/torquebox/messaging/future_status.rb
112
- - lib/torquebox/messaging/datamapper_marshaling.rb
113
- - lib/torquebox/messaging/message_processor.rb
114
- - lib/torquebox/messaging/backgroundable.rb
97
+ - lib/torquebox/messaging/clojure_message.rb
98
+ - lib/torquebox/messaging/text_message.rb
99
+ - lib/torquebox/messaging/xa_session.rb
115
100
  - lib/torquebox/messaging/connection_factory.rb
101
+ - lib/torquebox/messaging/session.rb
116
102
  - lib/torquebox/messaging/future_responder.rb
103
+ - lib/torquebox/messaging/backgroundable_processor.rb
104
+ - lib/torquebox/messaging/topic.rb
105
+ - lib/torquebox/messaging/future_status.rb
106
+ - lib/torquebox/messaging/marshal_base64_message.rb
107
+ - lib/torquebox/messaging/task.rb
108
+ - lib/torquebox/messaging/message.rb
109
+ - lib/torquebox/messaging/backgroundable.rb
110
+ - lib/torquebox/messaging/json_message.rb
111
+ - lib/torquebox/messaging/connection.rb
112
+ - lib/torquebox/messaging/xa_connection_factory.rb
113
+ - lib/torquebox/messaging/message_processor.rb
114
+ - lib/torquebox/messaging/core.rb
115
+ - lib/torquebox/messaging/marshal_message.rb
116
+ - lib/torquebox/messaging/datamapper_marshaling.rb
117
117
  - lib/torquebox/messaging/ext/javax_jms_queue_browser.rb
118
- - spec/message_spec.rb
119
118
  - spec/json_message_spec.rb
120
119
  - spec/future_spec.rb
121
120
  - spec/task_spec.rb
122
- - spec/datamapper_marshaling_spec.rb
123
- - spec/backgroundable_spec.rb
124
- - spec/message_processor_spec.rb
125
121
  - spec/destination_spec.rb
122
+ - spec/message_processor_spec.rb
123
+ - spec/message_spec.rb
124
+ - spec/backgroundable_spec.rb
125
+ - spec/datamapper_marshaling_spec.rb
126
126
  - spec/future_responder_spec.rb
127
127
  homepage: http://torquebox.org/
128
128
  licenses:
@@ -152,12 +152,12 @@ signing_key:
152
152
  specification_version: 3
153
153
  summary: TorqueBox Messaging Client
154
154
  test_files:
155
- - spec/message_spec.rb
156
155
  - spec/json_message_spec.rb
157
156
  - spec/future_spec.rb
158
157
  - spec/task_spec.rb
159
- - spec/datamapper_marshaling_spec.rb
160
- - spec/backgroundable_spec.rb
161
- - spec/message_processor_spec.rb
162
158
  - spec/destination_spec.rb
159
+ - spec/message_processor_spec.rb
160
+ - spec/message_spec.rb
161
+ - spec/backgroundable_spec.rb
162
+ - spec/datamapper_marshaling_spec.rb
163
163
  - spec/future_responder_spec.rb