You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by CASAUX Nicolas <ni...@soprasteria.com> on 2020/10/16 23:19:41 UTC

multiple consumers with ahc-ws component

Hello !

I have a requirement to open multiple websocket connections to an ActiveMQ broker.
As far as I understand, the only (?) Camel component for this is the ahc-ws component.

I managed to use it, however I can't open more than 1 connection to the ActiveMQ, because  I encounter a "already have a consumer" error on this endpoint when I try to open one more connection, which makes sense.
I already tried to use things like "from(ahc-ws://dummy)" and the Exchange.HTTP_URI header, but the component seems to ignore this header and it fails with a "java.net.UnknownHostException: (dummy)" error.

Any idea how could I achieve that ?

Thanks in advance!

Nicolas

RE: multiple consumers with ahc-ws component

Posted by CASAUX Nicolas <ni...@soprasteria.com>.
Thanks Claus, Jira is created! https://issues.apache.org/jira/browse/CAMEL-15716


-----Message d'origine-----
De : Claus Ibsen <cl...@gmail.com> 
Envoyé : mardi 20 octobre 2020 06:43
À : users@camel.apache.org
Objet : Re: multiple consumers with ahc-ws component

On Mon, Oct 19, 2020 at 11:32 PM CASAUX Nicolas <ni...@soprasteria.com> wrote:
>
> Hi Claus,
>
> I'm trying another component like you suggested, the new vertex-websocket component.
> I'm struggling with setting a stomp over websocket connection with the ActiveMQ.
>
> Netty keeps saying this:
> Caused by: 
> io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: 
> Invalid subprotocol. Actual: stomp. Expected one of: null
>
> I can't find where I could set-up the subprotocol value where I'd like to put "stomp", or "v12.stomp" etc...
> I can see in Netty source code that there are constructors which takes this subprotocol as a parameter, but I can't find (if it's possible) where I could pass this value from Camel.
> I looked into the vertxOptions of the component, but I couldn't find...
>
> Any hint on this ?
> Thanks !
>

Can you create a JIRA about this? And put in details where in netty you found that place to put in sub protocol.
Then we can better help and find a solution for this, as it would be great if the vertx based ws component would work with AMQ.


> Regards,
> Nicolas
>
> -----Message d'origine-----
> De : Claus Ibsen <cl...@gmail.com> Envoyé : samedi 17 octobre 
> 2020 17:48 À : users@camel.apache.org Objet : Re: multiple consumers 
> with ahc-ws component
>
> Hi
>
> There are a few other camel websocket components you can try also.
>
> On Sat, Oct 17, 2020 at 1:19 AM CASAUX Nicolas <ni...@soprasteria.com> wrote:
> >
> > Hello !
> >
> > I have a requirement to open multiple websocket connections to an ActiveMQ broker.
> > As far as I understand, the only (?) Camel component for this is the ahc-ws component.
> >
> > I managed to use it, however I can't open more than 1 connection to the ActiveMQ, because  I encounter a "already have a consumer" error on this endpoint when I try to open one more connection, which makes sense.
> > I already tried to use things like "from(ahc-ws://dummy)" and the Exchange.HTTP_URI header, but the component seems to ignore this header and it fails with a "java.net.UnknownHostException: (dummy)" error.
> >
> > Any idea how could I achieve that ?
> >
> > Thanks in advance!
> >
> > Nicolas
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: multiple consumers with ahc-ws component

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Oct 19, 2020 at 11:32 PM CASAUX Nicolas
<ni...@soprasteria.com> wrote:
>
> Hi Claus,
>
> I'm trying another component like you suggested, the new vertex-websocket component.
> I'm struggling with setting a stomp over websocket connection with the ActiveMQ.
>
> Netty keeps saying this:
> Caused by: io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid subprotocol. Actual: stomp. Expected one of: null
>
> I can't find where I could set-up the subprotocol value where I'd like to put "stomp", or "v12.stomp" etc...
> I can see in Netty source code that there are constructors which takes this subprotocol as a parameter, but I can't find (if it's possible) where I could pass this value from Camel.
> I looked into the vertxOptions of the component, but I couldn't find...
>
> Any hint on this ?
> Thanks !
>

Can you create a JIRA about this? And put in details where in netty
you found that place to put in sub protocol.
Then we can better help and find a solution for this, as it would be
great if the vertx based ws component would work with AMQ.


> Regards,
> Nicolas
>
> -----Message d'origine-----
> De : Claus Ibsen <cl...@gmail.com>
> Envoyé : samedi 17 octobre 2020 17:48
> À : users@camel.apache.org
> Objet : Re: multiple consumers with ahc-ws component
>
> Hi
>
> There are a few other camel websocket components you can try also.
>
> On Sat, Oct 17, 2020 at 1:19 AM CASAUX Nicolas <ni...@soprasteria.com> wrote:
> >
> > Hello !
> >
> > I have a requirement to open multiple websocket connections to an ActiveMQ broker.
> > As far as I understand, the only (?) Camel component for this is the ahc-ws component.
> >
> > I managed to use it, however I can't open more than 1 connection to the ActiveMQ, because  I encounter a "already have a consumer" error on this endpoint when I try to open one more connection, which makes sense.
> > I already tried to use things like "from(ahc-ws://dummy)" and the Exchange.HTTP_URI header, but the component seems to ignore this header and it fails with a "java.net.UnknownHostException: (dummy)" error.
> >
> > Any idea how could I achieve that ?
> >
> > Thanks in advance!
> >
> > Nicolas
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

RE: multiple consumers with ahc-ws component

Posted by CASAUX Nicolas <ni...@soprasteria.com>.
Hi Claus,

I'm trying another component like you suggested, the new vertex-websocket component.
I'm struggling with setting a stomp over websocket connection with the ActiveMQ.

Netty keeps saying this:
Caused by: io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid subprotocol. Actual: stomp. Expected one of: null

I can't find where I could set-up the subprotocol value where I'd like to put "stomp", or "v12.stomp" etc...
I can see in Netty source code that there are constructors which takes this subprotocol as a parameter, but I can't find (if it's possible) where I could pass this value from Camel.
I looked into the vertxOptions of the component, but I couldn't find...

Any hint on this ?
Thanks !

Regards,
Nicolas

-----Message d'origine-----
De : Claus Ibsen <cl...@gmail.com> 
Envoyé : samedi 17 octobre 2020 17:48
À : users@camel.apache.org
Objet : Re: multiple consumers with ahc-ws component

Hi

There are a few other camel websocket components you can try also.

On Sat, Oct 17, 2020 at 1:19 AM CASAUX Nicolas <ni...@soprasteria.com> wrote:
>
> Hello !
>
> I have a requirement to open multiple websocket connections to an ActiveMQ broker.
> As far as I understand, the only (?) Camel component for this is the ahc-ws component.
>
> I managed to use it, however I can't open more than 1 connection to the ActiveMQ, because  I encounter a "already have a consumer" error on this endpoint when I try to open one more connection, which makes sense.
> I already tried to use things like "from(ahc-ws://dummy)" and the Exchange.HTTP_URI header, but the component seems to ignore this header and it fails with a "java.net.UnknownHostException: (dummy)" error.
>
> Any idea how could I achieve that ?
>
> Thanks in advance!
>
> Nicolas



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: multiple consumers with ahc-ws component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There are a few other camel websocket components you can try also.

On Sat, Oct 17, 2020 at 1:19 AM CASAUX Nicolas
<ni...@soprasteria.com> wrote:
>
> Hello !
>
> I have a requirement to open multiple websocket connections to an ActiveMQ broker.
> As far as I understand, the only (?) Camel component for this is the ahc-ws component.
>
> I managed to use it, however I can't open more than 1 connection to the ActiveMQ, because  I encounter a "already have a consumer" error on this endpoint when I try to open one more connection, which makes sense.
> I already tried to use things like "from(ahc-ws://dummy)" and the Exchange.HTTP_URI header, but the component seems to ignore this header and it fails with a "java.net.UnknownHostException: (dummy)" error.
>
> Any idea how could I achieve that ?
>
> Thanks in advance!
>
> Nicolas



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2