activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JG <>
Subject JMS to Websocket using camel routes question
Date Thu, 27 Jun 2013 15:26:50 GMT

I've been trying to create a camel route from a JMS queue to a websocket
queue using activemq, but I've hit a wall, and I'm not sure where to go from
here given the examples in activemq or online.  It seems I have all the
components working, but I just can't connect them.

I'm using ActiveMQ 5.8.0, Camel 2.10.4, running on OSX 10.8.4 with (Apple)
Java 1.6.0_51, and stomp.js

Here's what I've done so far:

Added to activemq.xml
            <transportConnector name="websocket" uri="ws://"/>
        <import resource="camel.xml"/>

Added route to camel.xml
            <from uri="activemq:queue:fooQ"/>
            <to uri="activemq:queue:fooA"/>
            <to uri="websocket://foo?sendToAll=true"/>

Downloaded camel (2.10.4) and copied *camel-websocket-2.10.4.jar* to

Started activemq like so: *./activemq camel*

No errors reported and the route started:  console output

I publish data to the queue fooQ from java and I do receive the data in my
consuming app listening to fooA, but the html5 page using stomp.js never
receives the data.

Here's what I have in the html 5 page:

            <script type="text/javascript">

            var url = "ws://localhost:61614/stomp";
            var client = Stomp.client(url);

            var connect_callback = function() {

                var onmessage = function(message) {
                    alert('msg received: ' + message.body);
                    // called every time the client receives a message
                client.subscribe("foo", onmessage);


            client.connect('guest', 'guest', connect_callback);

I've been searching online for similar examples but really haven't found any
that helped.  Any help would be really appreciated.

Also, I can send ws messages from the included chat.js demo to my html5 and
it's received without an issue.  It's just the JMS to WS that's not working.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message