stomp-js / rx-stomp

STOMP adaptor for RxJS
Apache License 2.0
110 stars 21 forks source link

Nginx, Angular, ActiveMQ and Rx-stomp. #550

Open ale0xps opened 5 months ago

ale0xps commented 5 months ago

Hello I have a Angular app using rx-stomp to connect a stomp over ws.

ActiveMQ config:

<transportConnectors>
            <transportConnector name="openwire" uri="tcp://[0.0.0.0:10011?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600](http://0.0.0.0:10011/?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600)"/>
            <transportConnector name="amqp" uri="amqp://[0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600](http://0.0.0.0:5672/?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600)"/>
            <transportConnector name="stomp" uri="stomp://[0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600](http://0.0.0.0:61613/?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600)"/>
            <transportConnector name="mqtt" uri="mqtt://[0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600](http://0.0.0.0:1883/?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600)"/>
            <transportConnector name="ws" uri="ws://[0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600](http://0.0.0.0:61614/?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600)"/>
</transportConnectors>

with brokerURL: 'ws://MyActiveMQip:61614/stomp', in RxStompConfig it works great in local but I have to deploy my Angular App in a kubernetes pod with nginx like reverse proxy and I couldn't configure it successfully

I tried this nginx configuration:

inside the server:

location /stomp/ {
           proxy_pass http://MyActiveMQip:61614/;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
    }

What nginx configuration do I need? what do I need in brokerURL? Please help me and explian what do I have to do to connect my Angular app with rx-stomp to activeMQ through nginx

Thanks Regards