smart-que 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -3
  3. data/lib/smart_que/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca582aad4e979d17636afabc3eeb664a053d0cdd
4
- data.tar.gz: 7e1eb9afe2853bbb0bb1ae72c28660dbb34d0323
3
+ metadata.gz: 4cf953f15f60241f8a52e4025d4be07ddaced6cd
4
+ data.tar.gz: 0d054f939176d647268548a8c4e210435dec7876
5
5
  SHA512:
6
- metadata.gz: 4398c8b8013a0598d2245ef42162d4e6f691520a47867f6cb9b9742b026527323002abb6705a2282cb4becf148834e1139efb24549db9771b4ccfddf06fb4806
7
- data.tar.gz: ec489d820072181948b80def7642abc9618580d87237d35332ab662ffde11867da08ad4180cdea215cd1d52b83592b64116e7af7f960afeac9deae046a9cf576
6
+ metadata.gz: 63441db9cf0d5ca6b05786c80e3d34876c2f14b855fd45b9b72b3cea98df7bd290e1f02a573d878df716dab8007debec6456e0566a5bf1be23b0355ee89a6535
7
+ data.tar.gz: 33fb2dbcc03e158ab3b121a12d6f9875f4a8887bd96c458103adaf0fc9f4a19a7eed218c6ffd898c78cec5ceefb9c8ec42a4e6b5b165e2a288328d3d568d6b71
data/README.md CHANGED
@@ -23,7 +23,8 @@ Or install it yourself as:
23
23
 
24
24
  1. Setup [RabbitMq](https://www.rabbitmq.com/#getstarted)
25
25
  2. Add `smart-que` gem to your Gemfile and perform bundle install
26
- 3. Create Publisher/Consumer classes & start publish/consume messages
26
+ 3. Require `smart_que` in the application.rb file
27
+ 4. Create Publisher/Consumer classes & start publish/consume messages
27
28
 
28
29
  ## SmartQue Publisher
29
30
 
@@ -32,7 +33,7 @@ server. All messages are converted to JSON format before publishing to the queue
32
33
  RabbitMq server details and queue lists can be configured as follows
33
34
 
34
35
  ```
35
- file: config/initializers/smart_que.rb
36
+ # File: config/initializers/smart_que.rb
36
37
 
37
38
  SmartQue.configure do |f|
38
39
  f.host = ENV[:rabbit_mq][:host']
@@ -49,6 +50,10 @@ end
49
50
 
50
51
  $publisher = SmartQue::Publisher.new
51
52
 
53
+ # Add this below mentioned line to your application.rb
54
+ # File : config/application.rb
55
+
56
+ require 'smart_que'
52
57
  ```
53
58
 
54
59
  After initializing SmartQue publisher, it can be accessed anywhere in the rails application
@@ -65,12 +70,13 @@ listening to a defined Queue. The queue name and `run` method should be defined
65
70
  in each consumer class.
66
71
 
67
72
  ```
68
- Class OtpSmsConsumer < SmartQue::Consumer
73
+ class OtpSmsConsumer < SmartQue::Consumer
69
74
  QUEUE_NAME = 'sms.otp'
70
75
 
71
76
  def run(payload)
72
77
  # Payload: { number: '+919898123123', message: 'Test Message' }
73
78
  # Method implementation goes here
79
+ puts payload
74
80
  end
75
81
  end
76
82
  ```
@@ -103,6 +109,18 @@ end
103
109
  RAILS_ENV=staging bundle exec rake rabbitmq:send_otp_sms
104
110
  ```
105
111
 
112
+ ## RabbitMq Web Interface
113
+
114
+ You can enable rabbitmq_management plugin so that rabbitmq server informations
115
+ are viewed and managed via web console interface. Management plugin can be enabled
116
+ by running this command and can be accessed through [web browser](localhost:15672)
117
+
118
+ ```
119
+ rabbitmq-plugins enable rabbitmq_management
120
+ ```
121
+
122
+ More informations are available on RabbitMq [management plugin documentations](https://www.rabbitmq.com/management.html).
123
+
106
124
  ## Development
107
125
 
108
126
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module SmartQue
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart-que
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ashik Salman