activemessaging 0.12.2 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/activemessaging.gemspec +3 -3
- data/generators/processor/templates/broker.yml +1 -0
- data/lib/activemessaging/adapters/asqs.rb +9 -3
- data/test/asqs_test.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 745cf4dcd83298a2a575472d2da129aa1bd2ccd7
|
4
|
+
data.tar.gz: 3ab07801e599c5baa31d19865ed0aabcd92f23dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6393cae915d5ace65f376b441431ebbf8f7c3bec550b8718c159bbffb7e5d14552128eaf064e7fc3b47213d18e54783e6f3b698a10ab46845ae1f68c5dcf8710
|
7
|
+
data.tar.gz: 921d021a74156e8584f59af770a42cff70a2058e604f6e373c48f7b96f0d02b37d63fbcfc90873dddfd3dafe97d28ae7ae9de107754f993c2c5f9cfb8c3b5cd4
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.13.0
|
data/activemessaging.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: activemessaging 0.
|
5
|
+
# stub: activemessaging 0.13.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "activemessaging"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.13.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Jon Tirsen", "Andrew Kuklewicz", "Olle Jonsson", "Sylvain Perez", "Cliff Moon", "Uwe Kubosch", "Lance Cooper", "Matt Campbell"]
|
13
|
-
s.date = "2014-06-
|
13
|
+
s.date = "2014-06-18"
|
14
14
|
s.description = "ActiveMessaging is an attempt to bring the simplicity and elegance of rails development to the world of messaging. Messaging, (or event-driven architecture) is widely used for enterprise integration, with frameworks such as Java's JMS, and products such as ActiveMQ, Tibco, IBM MQSeries, etc. Now supporting Rails 3 as of version 0.8.0."
|
15
15
|
s.email = "activemessaging-discuss@googlegroups.com"
|
16
16
|
s.extra_rdoc_files = [
|
@@ -18,14 +18,13 @@ module ActiveMessaging
|
|
18
18
|
register :asqs
|
19
19
|
|
20
20
|
QUEUE_NAME_LENGTH = 1..80
|
21
|
-
MESSAGE_SIZE = 1..(8 * 1024)
|
22
21
|
VISIBILITY_TIMEOUT = 0..(24 * 60 * 60)
|
23
22
|
NUMBER_OF_MESSAGES = 1..255
|
24
23
|
GET_QUEUE_ATTRIBUTES = ['All', 'ApproximateNumberOfMessages', 'VisibilityTimeout']
|
25
24
|
SET_QUEUE_ATTRIBUTES = ['VisibilityTimeout']
|
26
25
|
|
27
26
|
#configurable params
|
28
|
-
attr_accessor :
|
27
|
+
attr_accessor :reconnect_delay, :access_key_id, :secret_access_key, :aws_version, :content_type, :host, :port, :poll_interval, :cache_queue_list, :max_message_size
|
29
28
|
|
30
29
|
#generic init method needed by a13g
|
31
30
|
def initialize cfg
|
@@ -43,6 +42,9 @@ module ActiveMessaging
|
|
43
42
|
@protocol = cfg[:protocol] || 'http'
|
44
43
|
@poll_interval = cfg[:poll_interval] || 1
|
45
44
|
@reconnect_delay = cfg[:reconnectDelay] || 5
|
45
|
+
|
46
|
+
@max_message_size = cfg[:max_message_size].to_i > 0 ? cfg[:max_message_size].to_i : 8
|
47
|
+
|
46
48
|
@aws_url="#{@protocol}://#{@host}"
|
47
49
|
|
48
50
|
@cache_queue_list = cfg[:cache_queue_list].nil? ? true : cfg[:cache_queue_list]
|
@@ -351,7 +353,11 @@ module ActiveMessaging
|
|
351
353
|
|
352
354
|
def validate_message m
|
353
355
|
raise "Message cannot be nil." if m.nil?
|
354
|
-
raise "Message length, #{m.length}, must be between #{
|
356
|
+
raise "Message length, #{m.length}, must be between #{message_size_range.min} and #{message_size_range.max}." unless message_size_range.include?(m.length)
|
357
|
+
end
|
358
|
+
|
359
|
+
def message_size_range
|
360
|
+
@_message_size_range ||= 1..(max_message_size * 1024)
|
355
361
|
end
|
356
362
|
|
357
363
|
def validate_timeout to
|
data/test/asqs_test.rb
CHANGED
@@ -49,6 +49,29 @@ EOM
|
|
49
49
|
@connection.disconnect unless @connection.nil?
|
50
50
|
end
|
51
51
|
|
52
|
+
def test_message_size
|
53
|
+
assert_equal @connection.max_message_size, 8
|
54
|
+
|
55
|
+
@connection = ActiveMessaging::Adapters::AmazonSqs::Connection.new(:reliable=>false, :access_key_id=>'access_key_id', :secret_access_key=>'secret_access_key', :max_message_size => 10)
|
56
|
+
|
57
|
+
assert_nothing_raised do
|
58
|
+
@connection.send @d, @message
|
59
|
+
end
|
60
|
+
|
61
|
+
large_message = "m" * 1024 * 9
|
62
|
+
assert_nothing_raised do
|
63
|
+
@connection.send @d, large_message
|
64
|
+
end
|
65
|
+
large_message = nil
|
66
|
+
|
67
|
+
large_message = "m" * 1024 * 11
|
68
|
+
assert_raise(RuntimeError) do
|
69
|
+
@connection.send @d, large_message
|
70
|
+
end
|
71
|
+
large_message = nil
|
72
|
+
|
73
|
+
end
|
74
|
+
|
52
75
|
def test_allow_underscore_and_dash
|
53
76
|
assert_nothing_raised do
|
54
77
|
@connection.subscribe 'name-name_dash'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemessaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Tirsen
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2014-06-
|
18
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activemessaging
|