Giter VIP home page Giter VIP logo

websocket-activemq-camel's Introduction

Example showing How to use WebSocket HTML 5 with ActiveMQ and Camel

ActiveMQ

  1. Download ActiveMQ 5.9 from this location http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/activemq/apache-activemq/5.9.0.redhat-610312/

or using Apache Release

http://repo1.maven.org/maven2/org/apache/activemq/apache-activemq/5.9.0/
  1. start Jetty Web Server

    cd websocket-activemq-camel/web mvn jetty:run

  2. Start ActiveMQ 5.x using the config provided in feeder/src/main/config directory

    cd /fuse/servers/apache-activemq-5.x/bin ./activemq console xbean:file:/Fuse/fuse-by-examples/websocket-activemq-camel/feeder/src/main/config/activemq-websocket.xml

  3. Compile and start Feed application

    cd websocket-activemq-camel/feed mvn -P run-trader

  4. Open your web browser at this address

    http://localhost:8282/stocks-activemq.html

and click on connect button

Remark : To connect from the web page to the ActiveMQ broker, the login to be used is guest & password is password

Camel

  1. Start Apache Camel Routes (without using wss://)

    cd websocket-activemq-camel/camel-ws mvn camel:run

  2. Compile and Start Feed application

    cd websocket-activemq-camel/feed mvn -P run-trader

  3. Verify stock and news websockets in your browser

    http://localhost:9090/stocks-camel.html http://localhost:9090/news-camel.html

    and click on connect button

To test SSL & wss:// protocol, execute the follownig command

  1. Start Apache Camel Routes (with wss:// & HTTPS)

    cd websocket-activemq-camel/camel-ws-ssl mvn camel:run

  2. Compile and Start Feed application

    cd websocket-activemq-camel/feed mvn -P run-trader

  3. Verify stock and news websockets in your browser

    https://localhost:8443/news-camel-wss.html

    and click on connect button

JBoss A-MQ

  1. Download JBoss A-MQ (https://access.redhat.com/downloads/) and unzip/untar the project locally

  2. Copy ActiveMQ config file containing ActiveMQ WebSocket transports connectors

    cp ~/Fuse/fuse-by-examples/websocket-activemq-camel/feeder/src/main/config/fuseamq-websocket.xml ~/Fuse/servers/jboss-a-mq-6.1.0.redhat-312/etc/activemq.xml

OR

cp ~/Fuse/fuse-by-examples/websocket-activemq-camel/feeder/src/main/config/org.fusesource.mq.fabric.server-default.cfg ~/Fuse/servers/jboss-a-mq-6.1.0.redhat-312/etc
cp ~/Fuse/fuse-by-examples/websocket-activemq-camel/feeder/src/main/config/fuseamq-websocket.xml ~/Fuse/servers/jboss-a-mq-6.1.0.redhat-312/etc/

3)) Add user guest and password password into the file etc/users.properties guest=password,admin

cp /Users/chmoulli/Fuse/fuse-by-examples/websocket-activemq-camel/feeder/src/main/config/users.properties ~/Fuse/servers/jboss-a-mq-6.1.0.redhat-312/etc
  1. Start JBoss A-MQ and install the web project

    install -s webbundle:mvn:com.fusesource.examples.websocket/web/1.0/war?Web-ContextPath=/activemq-websocket

  2. Connect to the web site http://localhost:8181/activemq-websocket/stocks-activemq.html

JBoss Fuse

! Twitter Demo does not work with current Camel 2.10 release as Twitter API 1.0 has been retired ! Camel 2.11 is required

  1. Download JBoss Fuse (https://access.redhat.com/downloads/) and unzip/untar the project locally

  2. Install features & bundles

Remark : bug discovered with websocket & static resources (https://issues.apache.org/jira/browse/CAMEL-6432) + ssl (https://issues.apache.org/jira/browse/CAMEL-6433)

First, install the XML resources file containing the definition about the modules to be deployed. This features file contains for each module (= a feature), the bundles, configurationss and parameters of the applications to be deployed and also references to others features/modules like camel, camel-twitter ...

features:addurl mvn:com.fusesource.examples.websocket/features/1.0/xml/features
features:install websocket-demo

The project can also be installed without using the features file created for this project but, in this case, using what is provisioned out of the box on JBoss Fuse platform.

features:install camel
features:install camel-websocket
features:install camel-twitter
features:install activemq-camel
install -s mvn:com.fusesource.examples.activemq.websocket/camel-ws/1.0
  1. Compile and Start Feed application

    cd websocket-activemq-camel/feed mvn -P run-trader

  2. Connect to the web site using these addresses :

    http://localhost:9090/news-camel.html http://localhost:9090/stocks-camel.html http://localhost:9090/chat-camel.html

Apache Karaf

  1. Download Apache Karaf (http://karaf.apache.org/index/community/download.html) and unzip/untar the project locally

  2. Install features & bundles

    features:addurl mvn:com.fusesource.examples.websocket/features/1.0/xml/features features:install websocket-demo

  3. Compile and Start Feed application

    cd websocket-activemq-camel/feed mvn -P run-trader

  4. Connect to the web site using these addresses :

    http://localhost:9090/news-camel.html http://localhost:9090/stocks-camel.html http://localhost:9090/chat-camel.html

websocket-activemq-camel's People

Contributors

cmoulliard avatar kevinearls avatar dejanb avatar

Watchers

Ben Haim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.