Over a million developers have joined DZone.
Platinum Partner

MessQ: A Simple Message Queue for Socket-Based Message Enqueue/Dequeue Facility

· Integration Zone

The Integration Zone is brought to you in partnership with Red Hat. Use these flashcards along with the popular open source integration framework Apache Camel as an easy reference during the design and development of integration projects.

I've spent a good amount of time setting up message-based infrastructures, so I decided to make a tool that would allow me to set up localhost friendly, network available message queues much quicker so I could try out all the things I wanted.

So here is Mess(age)Q(ueue). Something I've quickly thrown together. I will work on it later to get it more performance oriented, but right now it is good to go for smaller projects.

@GitHub:      https://github.com/abhishekkr/messQ
@RubyGems: https://rubygems.org/gems/messQ
_________________________

A Quick Test


[+] Install
$ gem install messQ --no-ri --no-rdoc


[+] Start Server (starts at 0.0.0.0 on port#5566)

$ messQ --start
[+] Enqueue user-id & home value to the Queue
$ messQ -enq $USER
$ messQ --enqueue $HOME
[+] Dequeue 2 values from Queue

$ messQ -deq
$ messq --dequeue
[+] Stop Server
$ messQ --stop
_________________________

Via Code


[+] Install


$ gem install messQ --no-ri --no-rdoc
or add following to your Gemfile
gem 'messQ'
require 'messQ'


[+] Start Server

MessQ.host = '127.0.0.1' # default is 0.0.0.0

MessQ.port = 8888 # default is 5566

MessQ.messQ_server


[+] Enqueue user-id & home value to the Queue

MessQ.host = '127.0.0.1' # default is 0.0.0.0

MessQ.port = 8888 # default is 5566

MessQ::Agent.enqueue(ENV['USER'])

MessQ::Agent.enqueue(ENV['HOME'])


[+] Dequeue 2 values from Queue


MessQ.host = '127.0.0.1' # default is 0.0.0.0

MessQ.port = 8888 # default is 5566

puts MessQ::Agent.dequeue

puts MessQ::Agent.dequeue


[+] Stop Server

MessQ::Server.stop

The Integration Zone is brought to you in partnership with Red Hat.  Discover how your integration architecture may be holding you back and 3 considerations for fixing it.

Topics:

Published at DZone with permission of Abhishek Kumar , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}