The Kaazing Universal WebSocket clients depend on the Kaazing WebSocket Gateway (KWG) being installed on one or more servers. KWG supports two protocols, AMQP and JMS.
- Download AMQP Gateway (Gateway + Documentation + Demos) from AMQP Gateway downloads page as a ZIP file This package also contains AMQP server Apache QPID see - Apache QPID for more information.
- Unzip the downloaded package to <your installation directory>
- By default, the Kaazing Gateway is configured to restrict communications and accept requests only from scripts that are served by the embedded HTTP server which may not be convenient for Web Development. In order to disable it
- Go to _<your installation directory>/kaazing-websocket-gateway-amqp-4.0.6/conf _
- Edit gateway_config.xml
- Locate lines
<allow-origin>http://${gateway.hostname}:${gateway.extras.port}</allow-origin> and replace them with <allow-origin>*</allow-origin> - Make sure that you have Java 7 or greater installed
- Open terminal window at <your installation directory>/kaazing-websocket-gateway-amqp-4.0.6/bin and start gateway
./gateway.start
- Open terminal window at <your installation directory>/qpid-java-broker-0.28/bin and start Apache QPID AMQP server
./qpid-server
- Note: to stop both Gateway and AMQP server just execute Ctrl-C on the relevant terminal windows or just close them.
- How to Build JavaScript Clients Using Kaazing WebSocket Gateway
- Use the Kaazing WebSocket Gateway JavaScript AMQP Client Library
- AMQP Facade library uses Fanout Exchange as the publishing endpoint which does not user Routing Key. Queue is automatically generated based on the unique client ID and is bound to the Exchange. For more information about Exchanges, Routing and Queues refer to RabbitMQ AMQP 0-9-1 Model Explained
- Download JMS Gateway (Gateway + Demos) from JMS Gateway Download Site as a ZIP file This package also contains JMS server Apache ActiveMQ see - Apache ActiveMQ for more information.
- Unzip the downloaded package to <your installation directory>
- By default, the Kaazing Gateway is configured to restrict communications and accept requests only from scripts that are served by the embedded HTTP server which may not be convenient for Web Development. In order to disable it
-
Goto _<your installation directory>/kaazing-websocket-gateway-jms-4.0.9/conf _
-
Open gateway_config.xml
-
Locate lines
<allow-origin>http://${gateway.hostname}:${gateway.extras.port}</allow-origin> and replace them with <allow-origin> *</allow-origin> -
Make sure that you have Java 7 or greater installed
-
Open terminal window at _<your installation directory>/kaazing-websocket-gateway-jms-4.0.9/bin _ and start gateway
./gateway.start
-
Open terminal window at _<your installation directory>/apache-activemq-5.10.0/bin _ and start Apache Active MQ JMS server
./activemq start
-
Note: to stop:
- Gateway: execute Ctrl-C on the relevant terminal windows or just close it.
- Apache ActiveMQ JMS Server: open terminal window at _<your installation directory>/apache-activemq-5.10.0/bin _ and execute
./activemq stop
-
- Build JavaScript JMS Clients Using Kaazing WebSocket Gateway - JMS Edition
- Use the Kaazing WebSocket Gateway JavaScript JMS Client API
- JMS Subscription created by the Facade Library is not durable - the client will not receive any messages that were sent before the subscription started. More information about durable subscriptions can be found at Messaging Patterns.
- Due to the blocking nature of JMS, application that use JMS client may receive an exception when sending large number of messages IllegalStateException: Message send already in progress