Connecting MQ from Rails?

Hi all,

I want to Connect to IBM MQ from Rails/Ruby, can it be done? and get the
messages from the Queue, then i want to use this message in ruby/rails.

Is there a direct way of doing the above job?? If so any packages are
available?

If there is not a way currently, and any thoughts of how we can do the
above job indirectly through some other means or round about ways or
workarounds can be thought of ?. Appreciate your comments.

Thank You,
Dinesh

In the past, I’ve done this via COM from a Windows PC running Ruby.
Works fine, and the throughput is surprisingly good.

You can find details of how to access MQ via COM from IBM’s site -
it’s in the downloadable documentation set, and wasn’t hard to track
down if my memory’s correct.

Details of how to use COM from Ruby on a Windows PC are in the
Programming Ruby book.

Regards

Dave M.

Another alternative would be to write an extension to make use of the C
API
directly (if you are not on windows). Seeing as MQ has about 70% market
share, I think this is a project folks might be willing to help with.

-Brian

Hi Brian,

Thanks for the reply. Ya since our production box is going to be on a
AIX box, i think i cannot go for COM interface and going with C
extension would be better we believe.

Do you have any docs / samples which access the MQI Interface using the
C extension from Ruby? If you have it can you pl let me know the
pointers pl?

Thank You
Dinesh

Brian McCallister wrote:

Another alternative would be to write an extension to make use of the C
API
directly (if you are not on windows). Seeing as MQ has about 70% market
share, I think this is a project folks might be willing to help with.

-Brian

Thanks Bryan for the replies.

So if i’m correct, what you meant is having an option to "Re-direct all
the messages from WebSphere MQ to ActiveMQ as and when it arrives ", and
then from ruby use STOMP to get the messages?

Thank You
Dinesh

Bryan L. wrote:

On Jun 23, 2006, at 1:24 AM, Dinesh U. wrote:

If there is not a way currently, and any thoughts of how we can do the
above job indirectly through some other means or round about ways or
workarounds can be thought of ?. Appreciate your comments.

You could use ActiveMQ as a bridge. ActiveMQ supports the STOMP
protocol which has ruby bindings.

On Jun 23, 2006, at 1:24 AM, Dinesh U. wrote:

If there is not a way currently, and any thoughts of how we can do the
above job indirectly through some other means or round about ways or
workarounds can be thought of ?. Appreciate your comments.

You could use ActiveMQ as a bridge. ActiveMQ supports the STOMP
protocol which has ruby bindings.

This

http://rubyforge.org/projects/yajb/

is pure ruby, and if you are familar with the MQ java api it may be the
way
to go.

I think it uses XML-RPC, which maybe a limiter to throughput, although
if
you are driving things from a webapp this may not be a problem.

cheers
lyndon

Hi Lyndon,

When i hit the link http://rubyforge.org/projects/yajb/, it says
“This Project Has Not Released Any Files” and the status says “Beta”, so
it is not published to rubyforge site yet??

Thanks…
Dinesh

Lyndon S. wrote:

This

http://rubyforge.org/projects/yajb/

is pure ruby, and if you are familar with the MQ java api it may be the
way
to go.

I think it uses XML-RPC, which maybe a limiter to throughput, although
if
you are driving things from a webapp this may not be a problem.

cheers
lyndon

An alternative to YAJB (beta) might be JRuby (beta) which we’ve been
working
very hard on. Performance is still sub-par, but you could very easily
wrap
JMS to provide access to MQ. Another option frequently suggested might
be to
implement a web service, but you’re adding a lot of overhead there.

If you’d be interested in exploring the JRuby angle, feel free to email
me
or join the JRuby mailing lists at www.jruby.org.

I’ve used this to drive some XSLFO stuff (using Apache FOP) and can say
it
works well (if you can get past the somewhat disturbing site of
Java-esque
code in your Ruby programs).

You can get to the actual download from the authors site:
Software Error(which
is linked from the rubyforge site as “Project Home Page”).

As to speed it uses a binary protocol by default in the newest version
so it
should be faster than the XML-RPC protocol that Lyndon mentions
(although
it’s not blisteringly fast either way).

Cheers

Muz