https://github.com/gizipp/sample-chat-rabbitmq-bunny
Sample simple chat using RabbitMQ (over Bunny)
https://github.com/gizipp/sample-chat-rabbitmq-bunny
bunny message-broker rabbitmq ruby
Last synced: about 1 month ago
JSON representation
Sample simple chat using RabbitMQ (over Bunny)
- Host: GitHub
- URL: https://github.com/gizipp/sample-chat-rabbitmq-bunny
- Owner: gizipp
- Created: 2017-12-06T11:17:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-06T11:49:13.000Z (over 7 years ago)
- Last Synced: 2025-01-20T18:36:16.813Z (3 months ago)
- Topics: bunny, message-broker, rabbitmq, ruby
- Language: Ruby
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sample-chat-rabbitmq-bunny
Sample simple chat using RabbitMQ (over Bunny)## Usage
Assumed you already have Ruby, RabbitMQ and installed.### Publishing & subscribing into certain topic
To publish message into topic, use this format ruby publisher.rb```ruby
ruby publisher.rb general john "Hello all!"
# [x] Sent Hello all! into #general as johnruby publisher.rb general jenny "Hello john, who are you?"
# [x] Sent Hello john, who are you? into #general as jennyruby publisher.rb secret_group jenny "All, anybody know who is john in general?"
ruby publisher.rb secret_group lisa "He is our new CEO"
ruby publisher.rb secret_group jenny "Ooops..."# [x] Sent All, anybody know who is john in general? into #secret_group as jenny
# [x] Sent He is our new CEO into #secret_group as lisa
# [x] Sent Ooops... into #secret_group as jenny```
### Subscribing into certain topic
To subscribe certain topic, use this format ruby subscriber.rb```ruby
# Subscribing into 'general' topic
ruby subscriber.rb general# Output
# [*] Waiting for messages from #general. To exit press CTRL+C
# [x] john: Hello all!
# [x] jenny: Hello john, how are you?# Subscribing into 'secret_group' topic
ruby subscriber.rb secret_group# Output
# [*] Waiting for messages from #secret_group. To exit press CTRL+C
# [x] jenny: All, anybody know who is john in general?
# [x] lisa: He is our new CEO
# [x] jenny: Ooops...```