SwitchYard 0.6 App in OpenShift via Forge

Version 3

    This article will describe the steps required to build a sample application using JBoss Forge. As OpenShift does not currently (2012-11-15) have the latest version of SwitchYard, this document will also describe the steps required to install a SwithYard 0.6 overlay into OpenShift.

     

    Prerequisites:

    Ant, Maven, Java, SwitchYard 0.6 Installer zip

     

    1. Install Forge

     

    Go to: http://forge.jboss.org/

     

    Download and install Forge 1.0.6.

     

    2. Install the OpenShift Command Line Tools

     

    https://openshift.redhat.com/community/get-started

     

    3. Unzip the SwithYard Installer and Install Forge Tools

     

    From the SwitchYard Installer directory, run:

     

    ant install

     

    Answer no to all questions except:

    "[input] Would you like to install the SwitchYard Forge Module (y/n)? ([y], n)"

     

    4. Create a test OpenShift Application

     

    rhc app create sytest8 jboss-as7

     

    5. Install SwitchYard to the App

     

    From the sample project's main directory, start forge. You should see output similar to this:

     

    Using Forge at /home/jsightler/javadevtools/jbossforge/latest

        _____                   

       |  ___|__  _ __ __ _  ___

       | |_ / _ \| `__/ _` |/ _ \  \\

       |  _| (_) | | | (_| |  __/  //

       |_|  \___/|_|  \__, |\___|

                       |___/     

     

     

    JBoss Forge, version [ 1.0.6.Final ] - JBoss, by Red Hat, Inc. [ http://jboss.org/forge ]

    [sytest8] sytest8 $

     

    Execute:

    project install-facet switchyard and say accept the defaults ("Y" to updating to a jar, and take the default app name)

     

    You should see results like this:

     

    [sytest8] sytest8 $ project install-facet switchyard

    ? Facet [switchyard] requires packaging type(s) [jar], but is currently [war]. Update packaging? (Note: this could deactivate other plugins in your project.) [Y/n] y

    ? Application name [sytest8]

    ***SUCCESS*** Installed [switchyard] successfully.

    Wrote /home/jsightler/project/openshift/sytest8/pom.xml

    Wrote /home/jsightler/project/openshift/sytest8/src/main/resources/META-INF

    [sytest8] sytest8 $

     

    6. Copy SwitchYard 0.6 Modules to Overlay Folder

     

    Copy the following modules from a fully installed SwitchYard 0.6 AS7 instance to .openshift/config/modules within your project:

    org/apache/deltaspike/*

    org/apache/camel/*

    org/apache/cxf/jaxrs/*

    org/jbpm/*

    org/drools/*

    org/switchyard/*

    batik/*

    com/google/protobuf/*

    com/google/guava/*

     

    7. Get the sample project from Github


    GitHub: https://github.com/jsight/openshift-switchyard-demo

     

    Modify the pom to match your project name (groupid, artifiactid, etc).

     

    Modify the port in src/main/resources/wsdl/OrderService.wsdl to match your deployment hostname on OpenShift.

     

    Modify the contextPath in src/main/resources/META-INF/switchyard.xml to match your desired context path

     

    8. Add all files to git and push

     

    git add -A; git commit -a -m "Adding sample project files"; git push

     

    9. Go to:

    http://appname-domain.rhcloud.com/contextPath/OrderService?wsdl

     

    Load this WSDL into your favorite SOAP test tool (eg, SoapUI) and send a sample request