fusebyexample_camel example tcpip proxy · github

4
1/3/2015 FuseByExample/camel-example-tcpip-proxy · GitHub https://github.com/FuseByExample/camel-example-tcpip-proxy 1/4 Explore Features Enterprise Blog HTTPS clone URL You can clone with HTTPS or Subversion. camel-example-tcpip-proxy / latest commit d0dcfdcd66 Fuse ESB (ServiceMix) example of Apache Camel acting as an TCP/IP Proxy with failover capability Switched to jboss.org repos, updated to GA version 379 kevinearls authored on Jun 9, 2014 client Updated the URI to use localhost instead of the 0.0.0.0 address so th… 2 years ago controller Fixed the controller module test case to not append line-feed ("\n") … 2 years ago images Update readme, pom files and images to JBoss Fuse 6.0.0 2 years ago router Updated the comment being added. 2 years ago .gitignore Update to JBoss Fuse 6.0.0.redhat-024 2 years ago README.md Initial commits for 6.1 release a year ago pom.xml Switched to jboss.org repos, updated to GA version 379 7 months ago Sign up Sign in Search 2 4 Star Fork FuseByExample / camel-example-tcpip-proxy Code Issues 0 Pull Requests 0 Pulse Graphs https://github.com/F Clone in Desktop Download ZIP 15 commits 2 branches 0 releases 6 contributors master branch: README.md This document describes a simple prototype that demonstrates the use of Fuse ESB to manage TCP/IP controller failover. Here is the design: Client sends TCP/IP messages to ESB acting as a proxy. A failover-capable router pickups up messages and sends them to Controller 1 using a TCP/IP service call. Controller 1 stamps the message as having been processed and returns it to the router, and then back to the Client application. If Controller 1 fails, the router fails over to Controller 2. For purposes of a fast prototype, Controller 1 and Controller 2 were run as simple Camel-Mina services run from the command line (external to the ESB) so they were easy to kill to demonstrate failover. In practice, additional Fuse ESB containers would be ideal to host controller services. JBoss Fuse 6.1.0 Maven 3.x -- http://maven.apache.org JDK 1.6 or 1.7 Using Fuse ESB to Manage Controller Failover Software Requirements: This repository

Upload: ajith54

Post on 09-Nov-2015

2 views

Category:

Documents


0 download

DESCRIPTION

FuseByExample

TRANSCRIPT

  • 1/3/2015 FuseByExample/camel-example-tcpip-proxy GitHub

    https://github.com/FuseByExample/camel-example-tcpip-proxy 1/4

    Explore Features Enterprise Blog

    HTTPS clone URL

    You can clone with HTTPS orSubversion.

    camel-example-tcpip-proxy /

    latestcommitd0dcfdcd66

    Fuse ESB (ServiceMix) example of Apache Camel acting as an TCP/IP Proxy with failover capability

    Switched to jboss.org repos, updated to GA version 379

    kevinearls authored on Jun 9, 2014

    client Updated the URI to use localhost instead of the 0.0.0.0 address so th 2 years ago

    controller Fixed the controller module test case to not append line-feed ("\n") 2 years ago

    images Update readme, pom files and images to JBoss Fuse 6.0.0 2 years ago

    router Updated the comment being added. 2 years ago

    .gitignore Update to JBoss Fuse 6.0.0.redhat-024 2 years ago

    README.md Initial commits for 6.1 release a year ago

    pom.xml Switched to jboss.org repos, updated to GA version 379 7 months ago

    Sign up Sign inSearch

    2 4 Star ForkFuseByExample / camel-example-tcpip-proxy

    Code

    Issues 0

    Pull Requests 0

    Pulse

    Graphs

    https://github.com/FuseByExample/camelexampletcpipproxy.git

    Clone in Desktop

    Download ZIP

    15 commits 2 branches 0 releases 6 contributors

    master branch:

    README.md

    This document describes a simple prototype that demonstrates the use of Fuse ESB to manageTCP/IP controller failover.

    Here is the design:

    Client sends TCP/IP messages to ESB acting as a proxy. A failover-capable router pickups upmessages and sends them to Controller 1 using a TCP/IP service call. Controller 1 stamps themessage as having been processed and returns it to the router, and then back to the Clientapplication.

    If Controller 1 fails, the router fails over to Controller 2. For purposes of a fast prototype, Controller 1and Controller 2 were run as simple Camel-Mina services run from the command line (external to theESB) so they were easy to kill to demonstrate failover. In practice, additional Fuse ESB containerswould be ideal to host controller services.

    JBoss Fuse 6.1.0Maven 3.x -- http://maven.apache.orgJDK 1.6 or 1.7

    Using Fuse ESB to Manage ControllerFailover

    Software Requirements:

    This repository

  • 1/3/2015 FuseByExample/camel-example-tcpip-proxy GitHub

    https://github.com/FuseByExample/camel-example-tcpip-proxy 2/4

    Download JBoss Fuse at http://www.redhat.com/jbossfuse/downloadUnzip the archive in a directory without spaces in its path.

    There are three modules: applications, controllers and router. Here is the layout in the file system:

    JBoss Fuse - RouterDemoclientcontrollerrouter

    Run the command bin/fuse in the root directory of JBoss Fuse. Here is what the console looks like:

    Launch a new terminal session, and run the command mvncleaninstall in the root directory of toplevel project. Make sure all projects build successfully.

    In the JBoss Fuse terminal session run the command:

    JBossFuse:karaf@root>features:installcamelminaJBossFuse:karaf@root>features:installcamelgroovyJBossFuse:karaf@root>osgi:installsmvn:com.fusesource.demo/proxyrouter/1.0.0SNAPSHOT

    You should see output like this, with a Bundle ID generated by the deployment:

    JBossFuse:karaf@root>osgi:installsmvn:com.fusesource.demo/proxyrouter/1.0.0SNAPSHOTBundleID:225JBossFuse:karaf@root>

    Installing Fuse

    Download and Install JBoss Fuse

    Project Layout

    Start Fuse ESB

    Building the projects

    Deploy the Router into Fuse ESB

  • 1/3/2015 FuseByExample/camel-example-tcpip-proxy GitHub

    https://github.com/FuseByExample/camel-example-tcpip-proxy 3/4

    Open two new terminal sessions and switch to the root of the controllers project in both. In onesession, execute this command to launch Controller 1:

    controller$mvnPcontroller1

    And in the other execute the command to launch Controller 2:

    controller$mvnPcontroller2

    Open a new terminal sessions and switch to the root of the applications project. In the session,execute this command to launch the test Client application:

    client$mvncamel:run

    You should see the Client sending and receiving messages like below. Notice the response has aelement, that initially contains 'Controller 1'

    Kill the Controller 1 session any way you like, and you should see uninterrupted message flow, withController 2 handling the messages (note the changes to 'Controller 2' at message 12):

    Restart Controller 1 and youll see it take control back from Controller 2 (this is user-defined behaviorin the configuration of the failover-load balancer)

    17:44:47INFOApacheCamel2.10.0.redhat60024(CamelContext:camel1)startedin0.573seconds17:44:47INFOSendingmessage1withdata:117:44:47.34817:44:47INFOReceived1message:117:44:47.348Controller117:44:48INFOSendingmessage2withdata:217:44:48.33517:44:48INFOReceived2message:217:44:48.335Controller117:44:49INFOSendingmessage3withdata:317:44:49.33517:44:49INFOReceived3message:317:44:49.335Controller117:44:50INFOSendingmessage4withdata:417:44:50.33417:44:50INFOReceived4message:417:44:50.334Controller117:44:51INFOSendingmessage5withdata:517:44:51.33417:44:51INFOReceived5message:517:44:51.334Controller117:44:52INFOSendingmessage6withdata:617:44:52.33417:44:52INFOReceived6message:617:44:52.334Controller1

    17:44:56INFOSendingmessage10withdata:1017:44:56.33417:44:56INFOReceived10message:1017:44:56.334Controller117:44:57INFOSendingmessage11withdata:1117:44:57.33517:44:57INFOReceived11message:1117:44:57.335Controller117:44:58INFOSendingmessage12withdata:1217:44:58.33417:44:58INFOReceived12message:1217:44:58.334Controller217:44:59INFOSendingmessage13withdata:1317:44:59.33417:44:59INFOReceived13message:1317:44:59.334Controller2

    17:45:26INFOSendingmessage40withdata:4017:45:26.33317:45:26INFOReceived40message:4017:45:26.333Controller217:45:27INFOSendingmessage41withdata:4117:45:27.33417:45:27INFOReceived41message:4117:45:27.334Controller217:45:28INFOSendingmessage42withdata:4217:45:28.33517:45:28INFOReceived42message:4217:45:28.335Controller117:45:29INFOSendingmessage43withdata:4317:45:29.33517:45:29INFOReceived43message:4317:45:29.335Controller117:45:30INFOSendingmessage44withdata:4417:45:30.33517:45:30INFOReceived44message:4417:45:30.335Controller1

    Launch the Controllers

    Launch Client

  • 1/3/2015 FuseByExample/camel-example-tcpip-proxy GitHub

    https://github.com/FuseByExample/camel-example-tcpip-proxy 4/4

    https://access.redhat.com/knowledge/docs/JBoss_Fuse/

    Links to additional documentation

    Status API Training Shop Blog About 2015 GitHub, Inc. Terms Privacy Security Contact