Why don't you use the http transport? Don't need WS for this...

http://activemq.apache.org/http-and-https-transports-reference.html


On Sun, Oct 13, 2013 at 7:52 AM, ako <and...@koelewijn.net> wrote:

> Hi,
>
> I want to create a camel route which consumes messages from an ActiveMQ
> topic. There's a firewall between the camel code and the ActiveMQ broker,
> the broker can only expose ports 80 and 443. Is it possible to create a
> camel route which receives messages from the broker using stomp over
> websockets?
>
> The broker has a websocket connector:
>
>         BrokerService brokerSvc = new BrokerService();
>         brokerSvc.setBrokerName("brkr1");
>         brokerSvc.addConnector("ws://localhost:80?trace=true");
>         brokerSvc.setPersistent(false);
>         brokerSvc.start();
>
> For the camel route i have the following code:
>
>         StompComponent stompComponent = new StompComponent();
>         stompComponent.setBrokerURL("ws://localhost:80");
>         camelContext.addComponent("stomp",stompComponent);
>
>                 from("stomp:topic:test").
>                         log(LoggingLevel.INFO, "received websocket msg
> ${id}, ${body}").
>                         setBody(simple("${body.ascii.toString()}")).
>                         to("file:///c:/tmp/to-stomp");
>
> When i run this i get the following error:
> ...
> Caused by: java.lang.Exception: Unsupported URI scheme 'ws'
>         at
> org.fusesource.stomp.client.Stomp.connectCallback(Stomp.java:119)
>         at
>
> org.apache.camel.component.stomp.StompEndpoint.doStart(StompEndpoint.java:73)
>         at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> ...
>
> Using ActiveMQ 5.8.0 and Camel 2.12.1.
>
> Is this possible at all?
>
> Thanks,
> Andrej
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-consuming-from-apache-mq-using-stomp-over-websockets-tp5741476.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Reply via email to