Can get it to work.

1st attempt:

    /* init broker */

    ...

        BrokerService brokerSvc = new BrokerService();
        brokerSvc.setBrokerName("brkr1");
        brokerSvc.addConnector("ws://localhost:61613?trace=true");
    ...

    /* route configuration */

    ....
    from("stomp:topic:test").
        log(LoggingLevel.INFO, "received websocket msg ${id}, ${body}").
        setBody(simple("${body.ascii.toString()}")).
        to("file:///c:/tmp/to-stomp");
    ....

This results in the following exception:

java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:444)
        at sun.nio.ch.Net.bind(Net.java:436)
        at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at
org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)

Seems like the stomp connector is trying to open a server endpoint, instead
of connecting to the broker as a consuming client.

I've also tried the following for setting up the route:

    from("stomp:topic:test?brokerURL=tcp://localhost:61613").
        log(LoggingLevel.INFO, "received websocket msg ${id}, ${body}").
        setBody(simple("${body.ascii.toString()}")).
        to("file:///c:/tmp/to-stomp");

This results in the following stacktrace:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: stomp://topic:test?brokerURL=tcp%3A%2F%2Flocalhost%3A61613
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{brokerURL=tcp://localhost:61613}]
        at
org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:189)
        at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:134)
        at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:508)
        ... 21 more

Which kind of weird as the documentation page for stomp indicates that you
can set a brokerURL parameter on the endpoint...

Thanks for helping,
Andrej



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-consuming-from-apache-mq-using-stomp-over-websockets-tp5741476p5741566.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to