STOMP Client compiled on Linux …

I happened to find a way to communicate with ActiveMQ server using Axis2/C. We needed to publish some messages that is come to Axis2/C services as JMS Topics. To do so I tried several method XMPP API, REST API and various c clients they given in the ActiveMQ site. But none of them didn't do the job for me.

I asked from the mailing list , about their recommended way? Many of them pointed me towards the STOMP client that they have in codehause. But problem with that client is , it is supposed to compiled on Mac OS X.

<quote href="http://stomp.codehaus.org/Building+libstomp">

The initial code for libstomp was developed using the X Code 2 IDE for OS X. So to build it right now you have to have a Mac and X Code 2 installed

</qutoe>

Got a checkout form here.

With just a little trick , I was able to compile it on Linux.

First, I had httpd-2.2.4 installed on my machine (debian-sid), then installation failed saying some apr_off_t error. Though I tried to find what happened I was unable to figure it out. While searching I saw that, somebody said that apr_off_t error, happened only with Apache 2.2 with Apache 2.0 series apr_off_t problem doesn't occur.Then I tried with httpd 2.0.59 , with following script

<snip>

#!/bin/bash
APACHE_HOME=/home/dinesh/softwares/httpd-2.0.59/deploy
gcc stomp.c -shared -olibstomp.so -I. -I$APACHE_HOME/include -L$APACHE_HOME/lib -lapr-0
gcc main.c -ostomp -I. -I$APACHE_HOME/include -L. -lstomp

</snip>

then It gave me , an error.

Finally, changed stop.c:48 as follows.

rc = apr_socket_create_ex(&connection->socket, socket_family, SOCK_STREAM, APR_PROTO_TCP, pool);

After that It compiled successfully :) , I was able to run , the given sample.

[digg=http://digg.com/software/Stomp_clinet_compiled_on_linux]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • Wists
  • blogmarks
  • Furl
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb