magellan-publisher 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8009042b4cf90b3a91fd1063b3fd7f558eba3b87
4
- data.tar.gz: 40ba2d7b358fb62dc7fe365698214469cbd609ab
3
+ metadata.gz: 4effeb9d0a441dd116af6b7d85297e70687411e4
4
+ data.tar.gz: feb34baac7ff902bfe5dba4031ec9ef66318fd78
5
5
  SHA512:
6
- metadata.gz: c250a3822a1beb4232a224d5b8a0e8ec1ca9ecef23e56567515cd4b6abd4aa1285867ecfba9cafa6468bf75dbdb5166c1be92d294e0d2ba8b090d61ab765356f
7
- data.tar.gz: 3208a67faed86c583004da0caf663790e6b1c6e5ca171770887d52cf04841874c9d10d7c62c5c9c62587bde34f04ecfaf598310d9668372fb09e38b7e275db75
6
+ metadata.gz: 5fc14f652a92b431d6698f5aae430ce75d88538b6f104e7cea32d565ae3573e7545694d98ea468baf1c25d8d791b020edd833a131c521bbd422b4e3ce8570894
7
+ data.tar.gz: bb999eae590bdafc96d4cb9d59789d676541325df051e6bc74885dacfcbe97e9add7e71e3079bf10cd74b70751ec6a72e6855187eee88de98301b4da2a8f91de
@@ -27,8 +27,9 @@ module Magellan
27
27
  # publish message size limit
28
28
  @message_size_limit = load_env_as_default(nil, ["MAGELLAN_PUBLISH_MESSAGE_SIZE_LIMIT"], :integer) || (256 * 1024 * 1024)
29
29
  # message size limit should be treated equally with MQTT message.
30
- # substruct MQTT's topic length + packet identifier size (4 bytes)
31
- @message_size_limit -= 4
30
+ # substruct MQTT's topic length (2 bytes)
31
+ # currently magellan-publisher can publish message only in QoS=0 mode. so packet identifier record is not included in a packet.
32
+ @message_size_limit -= 2
32
33
  end
33
34
 
34
35
  def convert_topic(mqtt_topic)
@@ -38,7 +39,7 @@ module Magellan
38
39
 
39
40
  def publish(topic, body)
40
41
  if topic.bytesize + body.bytesize > @message_size_limit
41
- raise MessageTooLong, "publishing topic(#{topic.bytesize} bytes) and payload(#{body.bytesize}) exceed message size limitation#{@message_size_limit}."
42
+ raise MessageTooLong, "publishing topic(#{topic.bytesize} bytes) and payload(#{body.bytesize} bytes) exceed message size limitation(#{@message_size_limit} bytes)."
42
43
  end
43
44
  @exchange.publish(body, routing_key: convert_topic(topic))
44
45
  end
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  class Publisher
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magellan-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomoyuki Chikanaga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-09 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.4.6
120
+ rubygems_version: 2.4.5
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: ''