activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <>
Subject Re: Stomp client for java, seems to hang?
Date Mon, 06 Apr 2009 07:30:47 GMT
Hi Johan,

ActiveMQ shouldn't be used "as a Java client against Stomp". JMS and Stomp
are two distinct protocols. If you want to send messages from your Java
clients (to ActiveMQ or JBoss) use appropriate JMS API. Stomp is usually
used to do messaging in scripting languages (such as Ruby e.g.). ActiveMQ
supports Stomp directly, so you can send/receive messages directly from your
scripts. StompConnect is used to provide the same funcionality for other
brokers, such as JBoss for example. Finally, ActiveMQ provides Stomp Java
API (, but it is
different from JMS API (and it is primaraly used for testing).

Hope this helps.

Dejan Bosanac

Open Source Integration -
ActiveMQ in Action -
Blog -

On Sun, Apr 5, 2009 at 9:40 AM, Johan Kindgren <>wrote:

> I've sent this question to the users-list previously but with no response.
> I've done a quick test where I tried to publish JMS queues via
> StompConnect ( and then use
> ActiveMQ as a JMS implementation for handling the published
> queues.Unfortunately this didn't work at all, and from spending a day
> in debug-mode and stepping through the Stomp implementation it seems
> that there are something missing. Maybe my setup is all wrong, but my
> short question is if anyone has tried to use ActiveMQ as a java client
> against StompConnect?
> The following setup was used:
> Server side:
> Create an instance of StompConnect and inject the ConnectionFactory of
> a JBoss server (Jboss Messaging).
> At the client side:
> 1. Create an instance of ActiveMQConnectionFactory and set the url to
> "stomp://localhost:61613".
> 2. Create an instance of ActiveMQQueue and set the queue-name.
> 3. Since we are using Spring, create a JmsTemplate and try to send a
> message.
> The ConnectionFactory seems to find the right implementation and
> creates a ActiveMQConnection and sets the transport layer to use the
> stomp package. The first thing that the ActiveMQConnection does is to
> send a ConnectionInfo command, but the stomp transport implementation
> decides that this command shouldn't be sent. Now comes the tricky
> part, the layer above (ResponseCorrelator) expects a response and
> simply hangs.
> Since I'm new to ActiveMQ I'm really not sure if it's possible to use
> the JMS-api in the above describe way. My questions are:
> 1. Should I be able to use the Jms api as a wrapper against the stomp
> protocol?
> 2. Has anyone used the Stomp-client implementation?
> Tried both ActiveMQ 5.2.0 and 5.1.0, seems to be no changes in the
> Stomp-implementation.
> I've created a testcase that shows the problem, see attached file. My
> test hangs in the setup, while creating a Jms session, so I'm not sure
> that the actual test will really work if it would get past the
> session-problem.
> /Johan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message