bi-frost 0.2.1 → 0.2.2

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: 5e255e89bd67722c08e188f52a8a2cd525619a2f
4
- data.tar.gz: 8e6d145f9bc4e23b16f267b6a05c181d1d0ceb64
3
+ metadata.gz: 90e78824096123ba6bb0fd116ce9d26160b9ce75
4
+ data.tar.gz: e3e59050c9f7b6322c7b565d165249ab420b830f
5
5
  SHA512:
6
- metadata.gz: f43426818f7128d563831fc155f4979c03b4e233a845a2793974f8205c3a0224f0fc11a174885c5ca5300dd3e30f8e5e6b676c60a04b37ba1588ee1058f787b2
7
- data.tar.gz: 0cffed6ad3521a206bb61cbefa1139c3ad4136763d81a0802bb69ccf6f79d1ceded0d951b53812412e059824cb7d9321620bc526542500bbae3b04be1d1baa7d
6
+ metadata.gz: 1af54f96b24f16e7d81401e355bb9c3a54784dd0503e8afc38596124d18634ce60b456cb91dbe86cf5d0376f1b32235d8c6be45436f8edcbd778d5fa365e0e68
7
+ data.tar.gz: b125fedad0f351203691cf7f9b62bfb7f75d0ed328d524104990eea04065f1a33362b4c86aeca7e20e0f4dc4ead9c70ca3bf7b618f90538564e06a12b3928472
data/README.md CHANGED
@@ -76,7 +76,7 @@ message = Bifrost::Message.new(content: 'some data', 'message subject')
76
76
  message.publish(topic)
77
77
  ```
78
78
 
79
- An alternative method named `publish!` also exists. This method raises an error is a message cannot be delivered. The error raised is `Bifrost::Exceptions::MessageDeliveryError`. If the message is successfully delivered with the method `publish!`, the messages `UUID` is returned in the call.
79
+ An alternative method named `publish!` also exists. This method raises an error is a message cannot be delivered. The error raised is `Bifrost::Exceptions::MessageDeliveryError`. If the message is successfully delivered with the method `publish!`, the messages `UUID` is returned in the call. If a message is re-delivered it's message identifier changes. In the Bifrost each message even if it contains duplicate information is viewed as a different/unique message.
80
80
 
81
81
  Subscribers in the Bifrost are [actors](http://http://doc.akka.io/docs/akka/2.4/general/actors.html), these actors run in their own threads. At present the Bifrost does not support thread pools, this is something we are investigating and are hoping to add at some point. In the Bifrost each actor is referred to as a `worker`. A worker is designed to receive
82
82
  messages published to a particular topic with a specific subscriber in mind (refer to the fan-out comment earlier).
@@ -55,7 +55,7 @@ module Bifrost
55
55
  # Update the status of the message post delivery
56
56
  def update_message_state_to_delivered(message)
57
57
  @status = :delivered
58
- @message_id ||= message.correlation_id
58
+ @message_id = message.correlation_id
59
59
  end
60
60
  end
61
61
  end
@@ -9,7 +9,7 @@ module Bifrost
9
9
 
10
10
  # The patch version of Bifrost, updated only for bug fixes from the last
11
11
  # feature release.
12
- PATCH_VERSION = 1
12
+ PATCH_VERSION = 2
13
13
 
14
14
  # The full version as a string.
15
15
  VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}".freeze
@@ -52,6 +52,20 @@ describe Bifrost::Message do
52
52
  topic.delete
53
53
  end
54
54
 
55
+ it 'should update the message id on a replublish of the same messsage' do
56
+ topic = Bifrost::Topic.new('valid-topic')
57
+ topic.save
58
+ topic.add_subscriber(Bifrost::Subscriber.new('new_subscriber'))
59
+ response = message.publish!(topic)
60
+ expect(response).not_to be_nil
61
+ expect(message.status).to eq(:delivered)
62
+ expect(message.message_id).not_to be_nil
63
+ expect(response).to eq(message.message_id)
64
+ upd_response = message.publish!(topic)
65
+ expect(upd_response).not_to eq(response)
66
+ topic.delete
67
+ end
68
+
55
69
  it 'should raise an exception upon publish to an invalid topic' do
56
70
  topic = Bifrost::Topic.new('invalid-topic')
57
71
  expect { message.publish!(topic) }.to raise_error(Bifrost::Exceptions::MessageDeliveryError)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bi-frost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shirren Premaratne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure