You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by IODB <iv...@caffeinated-consulting.com> on 2019/01/12 07:16:02 UTC

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Is there anything I can do to help this moving forward?



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Sorry, I was busy with Karaf stuff.

I resume my investigation on this one. You tried with ActiveMQ
5.15.9-SNAPSHOT right ?

Regards
JB

On 12/01/2019 08:16, IODB wrote:
> Is there anything I can do to help this moving forward?
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

We changed the way of loading ActiveMQ broker because:

1. we wanted to not depend on blueprint
2. blueprint container has some constraint

So, I fixed (in ActiveMQ 5.15.8) the ws connector generally speaking,
but not specifically for blueprint.

You can still use a several broker config via ConfigAdmin anyway.

Regards
JB

On 13/01/2019 18:38, IODB wrote:
> Hi JB,
> 
> Ah yes, that was how we did it I believe when we were still running the 3.x
> version of Karaf.
> The approach I described earlier worked for Karaf 4.0.x, but no longer in
> 4.1.0 or newer.
> 
> It's been a while, but believe we preferred this approach for several
> reasons, including that we had no dependency on Spring and that we could
> embed the broker info inside a blueprint xml inside one of our bundles. This
> way the lifecycle of the broker was aligned with that of the bundle.
> 
> At least in 3.x I also vaguely recall having issues with multiple versions
> of Spring being loaded.
> 
> You don't happen to know an easy way to get mqtt-over-websockets to work
> with a blueprint broker config embedded in a bundle?
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by IODB <iv...@caffeinated-consulting.com>.
Hi JB,

Ah yes, that was how we did it I believe when we were still running the 3.x
version of Karaf.
The approach I described earlier worked for Karaf 4.0.x, but no longer in
4.1.0 or newer.

It's been a while, but believe we preferred this approach for several
reasons, including that we had no dependency on Spring and that we could
embed the broker info inside a blueprint xml inside one of our bundles. This
way the lifecycle of the broker was aligned with that of the bundle.

At least in 3.x I also vaguely recall having issues with multiple versions
of Spring being loaded.

You don't happen to know an easy way to get mqtt-over-websockets to work
with a blueprint broker config embedded in a bundle?



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I will try with the activemq-broker feature and changing the
activemq.xml in the etc folder.

I will let you know.

Regards
JB

On 12/01/2019 11:08, IODB wrote:
> Of course it is never wise to assume I'm not doing something stupidly wrong
> ;-)
> 
> I just retried with the latest versions:
> 
> - install karaf 4.2.2
> 
> - run shell commands:
> feature:repo-add activemq 5.16.0-SNAPSHOT 
> feature:repo-add spring-legacy
> feature:install shell-compat
> feature:install aries-blueprint
> feature:install activemq-blueprint
> feature:install jetty
> bundle:dynamic-import <id of bundle activemq-osgi>
> bundle:dynamic-import <id of bundle activemq-karaf>
> 
> - copy a blueprint activemq.xml to the /deploy directory containing 
> <transportConnector name="websocket" uri="ws://0.0.0.0:8182" />
> 
> This still seems to result in
> ClassNotFoundException:org.eclipse.jetty.websocket.server.WebSocketServerFactory 
> and a failure to start the "activemq.xml" bundle
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I just did a quick test with Karaf 4.2.1.

Here's what I did:

1. On a fresh Karaf 4.2.1, I install the activemq-broker feature:

karaf@root()> feature:repo-add activemq 5.15.8
karaf@root()> feature:install activemq-broker

2. The activemq-broker installs etc/activemq.xml, I edited this file to
add the ws connector:

<transportConnector name="ws" uri="ws://0.0.0.0:8282"/>

3. I restart Karaf to load the change and start all transport connectors.

4. The ws transport connector starts fine:

18:06:35.029 INFO [Broker Starting Thread] Apache ActiveMQ 5.15.8
(amq-broker, ID:precision-41085-1547399194903-0:1) is starting
18:06:35.045 INFO [Broker Starting Thread] Listening for connections at:
tcp://precision:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
18:06:35.046 INFO [Broker Starting Thread] Connector openwire started
18:06:35.048 INFO [Broker Starting Thread] Starting Jetty server
18:06:35.050 INFO [Broker Starting Thread] Creating Jetty connector
18:06:35.092 INFO [Broker Starting Thread] jetty-9.4.12.v20180830;
built: 2018-08-30T13:59:14.071Z; git:
27208684755d94a92186989f695db2d7b21ebc51; jvm 1.8.0_172-b11
18:06:35.147 WARN [Broker Starting Thread]
ServletContext@o.e.j.s.ServletContextHandler@6f7ee618{/,null,STARTING}
has uncovered http methods for path: /
18:06:35.481 INFO [Broker Starting Thread] Started
o.e.j.s.ServletContextHandler@6f7ee618{/,null,AVAILABLE}
18:06:35.496 INFO [Broker Starting Thread] Started
ServerConnector@ad64d7d{HTTP/1.1,[http/1.1]}{0.0.0.0:8282}
18:06:35.497 INFO [Broker Starting Thread] Started @4244ms
18:06:35.498 INFO [Broker Starting Thread] Listening for connections at
ws://precision:8282
18:06:35.498 INFO [Broker Starting Thread] Connector ws started
18:06:35.498 INFO [Broker Starting Thread] Apache ActiveMQ 5.15.8
(amq-broker, ID:precision-41085-1547399194903-0:1) started

You can see the openwire/tcp and ws connectors started.

So all good ;)

Regards
JB

On 12/01/2019 11:08, IODB wrote:
> Of course it is never wise to assume I'm not doing something stupidly wrong
> ;-)
> 
> I just retried with the latest versions:
> 
> - install karaf 4.2.2
> 
> - run shell commands:
> feature:repo-add activemq 5.16.0-SNAPSHOT 
> feature:repo-add spring-legacy
> feature:install shell-compat
> feature:install aries-blueprint
> feature:install activemq-blueprint
> feature:install jetty
> bundle:dynamic-import <id of bundle activemq-osgi>
> bundle:dynamic-import <id of bundle activemq-karaf>
> 
> - copy a blueprint activemq.xml to the /deploy directory containing 
> <transportConnector name="websocket" uri="ws://0.0.0.0:8182" />
> 
> This still seems to result in
> ClassNotFoundException:org.eclipse.jetty.websocket.server.WebSocketServerFactory 
> and a failure to start the "activemq.xml" bundle
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by IODB <iv...@caffeinated-consulting.com>.
Of course it is never wise to assume I'm not doing something stupidly wrong
;-)

I just retried with the latest versions:

- install karaf 4.2.2

- run shell commands:
feature:repo-add activemq 5.16.0-SNAPSHOT 
feature:repo-add spring-legacy
feature:install shell-compat
feature:install aries-blueprint
feature:install activemq-blueprint
feature:install jetty
bundle:dynamic-import <id of bundle activemq-osgi>
bundle:dynamic-import <id of bundle activemq-karaf>

- copy a blueprint activemq.xml to the /deploy directory containing 
<transportConnector name="websocket" uri="ws://0.0.0.0:8182" />

This still seems to result in
ClassNotFoundException:org.eclipse.jetty.websocket.server.WebSocketServerFactory 
and a failure to start the "activemq.xml" bundle



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, you also tried dynamic import on the ActiveMQ bundle (not
your bundle), using the dynamic import shell command ?

Regards
JB

On 12/01/2019 08:16, IODB wrote:
> Is there anything I can do to help this moving forward?
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com