Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Workshop - Building SOA applications with JBoss Fuse Service Works

Workshop - Building SOA applications with JBoss Fuse Service Works

Red Hat JBoss Fuse Service Works is Red Hat’s middleware solution for application integration, messaging, SOA, and service governance requirements. It combines multiple technologies from the middleware portfolio. Camel, CXF and ActiveMQ comprise the core ESB technology, SwitchYard provides the lightweight service development framework, and Overlord provides the design-time and run-time governance.
In this talk, we’ll walk you through the Red Hat Fuse Service Works home-loan application. This application processes a home-loan application through the system to arrive at a decision. The application uses multiple technologies, including Camel, business processes, and rules.
This will provide an opportunity for some hands-on work and to learn how to:

• Manage application life cycle through design-time governance

• Capture service activity through run-time governance.

• Build a SwitchYard application and use Camel, business processes, and rules in the application.

Kenneth Peeples

June 26, 2014
Tweet

More Decks by Kenneth Peeples

Other Decks in Technology

Transcript

  1. Workshop - Building SOA applications with JBoss Fuse Service Works

    Kenneth Peeples JBoss Technology Evangelist June 26, 2014 [email protected] ossmentor.com
  2. RED HAT CONFIDENTIAL | ADD NAME 2 Abstract Red Hat

    JBoss Fuse Service Works is Red Hat’s middleware solution for application integration, messaging, SOA, and service governance requirements. It combines multiple technologies from the middleware portfolio. Camel, CXF and ActiveMQ comprise the core ESB technology, SwitchYard provides the lightweight service development framework, and Overlord provides the design- time and run-time governance. In this talk, we’ll walk you through the Red Hat Fuse Service Works home-loan application. This application processes a home-loan application through the system to arrive at a decision. The application uses multiple technologies, including Camel, business processes, and rules. This will provide an opportunity for some hands-on work and to learn how to: • Manage application life cycle through design-time governance • Capture service activity through run-time governance. • Build a SwitchYard application and use Camel, business processes, and rules in the application.
  3. RED HAT CONFIDENTIAL | ADD NAME 3 Agenda for the

    Workshop • Review the workshop material (10 minutes) • Review Fuse Service Works (10 minutes) • Review setup (20 minutes) • Attendee Hands on Lab (rest of the time and homework) Please raise your hand for any questions.
  4. RED HAT CONFIDENTIAL | ADD NAME 4 The workshop is:

    • A step by step guide to building a Home Loan demo • Intended to show the capabilities of Fuse Service Works Server and Designer • A work in progress, Lab 1-Switchyard and Lab 2-DTGov are stable. Lab 3-RTGov will be updated for the Home Loan Application. • A hands on work shop • To be started in class and finished at home/office if not completed The workshop is NOT: • A 5 minute guide to Fuse Service Works • Intended to showcase a demo until the end of each lab If you have any issue please send me an email ([email protected]), chat with me (kpeeples on IRC) or submit an issue at https://github.com/jboss-switchyard/learning/issues Expectations for the workshop
  5. RED HAT CONFIDENTIAL | ADD NAME 9 Workshop Material Workshop

    location: https://github.com/jboss-switchyard/learning/tree/master/summit2014 Github Repo: https://github.com/jboss-switchyard/learning.git Folders under summit 2014: Guides – This contains the key, ppt and pdf files for the guides. You will be using the PDFs. In the future they will be in asciidoc format. It contains intro, lab1-lab3 Lab 1 – Contains the Switchyard application that will be completed during the exercise Lab 2 – Contains the Switchyard application in finished form from lab 1 or you can just use your code at the end of lab 1. This demonstrates DTGov. Lab 3 – Contains the files necessary for for the RTGov quickstart. It is currently beign modified for the home loan demo.
  6. RED HAT CONFIDENTIAL | ADD NAME 10 Setup Options for

    your environment Option 1: Use the simplified FSW template with the automated script Option 2: Use the Dockerfile for a docker container Additional configuration required afterwards.
  7. RED HAT CONFIDENTIAL | ADD NAME 11 Option 1: Use

    the simplified FSW template with the automated script Install Fuse Service Works Step 1: Clone the repository from https://github.com/kpeeples/simplified-fsw-template.git Step 2: Download Fuse Service Works from http://www.jboss.org/products/fsw.html Step 3: Place the software in the distros folder Step 4: Modify the support/InstallationScript.xml file to contain the full path to the installed/fsw directory. Make sure to leave the installed/fsw directory. The script performs the automated install of Fuse Service Works. You will notice in the installation script the components that are being installed. Also you will notice the variables file defines the passwords for Goverrnance, SAML keystore and vault keystore passwords. NOTE: This is installing the Switchyard, DTGov, S-RAMP and RTGov components which wouldn’t be the recommended setup as Design Time would be a separate server from the Switchyard/Run Time Server. <installpath>/home/kpeeples/demos/fsw-simple-demo/installed/fsw</installpath> Step 5: Run the install-run.sh script to install FSW
  8. RED HAT CONFIDENTIAL | ADD NAME 12 Option 1: Use

    the simplified FSW template with the automated script Configure Fuse Service Works Step 1A: Setup the Database – Copying Files Copy from the support directory the customer db files to $FSW_HOME/jboss-eap- 6.1/standalone/data/h2/ Step 1B: Setup the Database - Manual Launch the H2 db and console via the h2 jar in your FSW install java -jar modules/system/layers/base/com/h2database/h2/main/h2-1.3.168-redhat- 2.jar At the login screen for the H2 console, use the following values. $FSW_HOME is where you have installed FSW; be sure to replace this with the actual directory for your installation. JDBC URL: jdbc:h2:file:$FSW_HOME/jboss-eap- 6.1/standalone/data/h2/customer;mvcc=true User Name : sa Password : sa
  9. RED HAT CONFIDENTIAL | ADD NAME 13 Option 1: Use

    the simplified FSW template with the automated script Configure Fuse Service Works Step 1B: Setup the Database – Manual (Continued) In the console, create a table: CREATE TABLE CUSTOMER( SSN VARCHAR(11) PRIMARY KEY, FIRSTNAME VARCHAR(50), LASTNAME VARCHAR(50), STREETADDRESS VARCHAR(255), CITY VARCHAR(60), STATE VARCHAR(2), POSTALCODE VARCHAR(60), DOB DATE, CHECKINGBALANCE DECIMAL(14,2), SAVINGSBALANCE DECIMAL(14,2)); And insert some test data: INSERT INTO CUSTOMER VALUES ('800559876', 'Joe', 'Deeppockets-existing', '345 Pine Ave', 'Springfield', 'MO', '65810', '1966- 07-04', 14000.40, 22000.99); INSERT INTO CUSTOMER VALUES ('610761010', 'Sally', 'Shortchange-existing', '456 Larch Lane', 'Springfield', 'MA', '99999', '1966-08-05', 9100.10, 2750.75); INSERT INTO CUSTOMER VALUES ('680777098', 'Barbara', 'Borderline-existing', '567 Poplar Pkwy', 'Worcester', 'MA', '01604', '1976-09-06', 300.41, 11.01);
  10. RED HAT CONFIDENTIAL | ADD NAME 14 Option 1: Use

    the simplified FSW template with the automated script Configure Fuse Service Works Step 2: Configure FSW (A example copy of standalone.xml is under the support folder) Add the following datasource definition to standalone-full.xml: <datasource jndi-name="java:jboss/datasources/CustomerDS" pool- name="CustomerDS" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:file:$ {jboss.server.data.dir}/h2/customer;mvcc=true</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource>
  11. RED HAT CONFIDENTIAL | ADD NAME 15 Option 1: Use

    the simplified FSW template with the automated script Configure Fuse Service Works Step 3: Setup JMS Add the JMS user ${FSW_HOME}/bin/add-user.sh Application User Application Realm Username : guest Password : guestp.1 Roles : guest Start the server: bin/standalone.sh In a separate terminal window, add a JMS queue: bin/jboss-cli.sh --connect --command="jms-queue add --queue- address=LoanIntake --entries=LoanIntake"
  12. RED HAT CONFIDENTIAL | ADD NAME 16 Option 1: Use

    the simplified FSW template with the automated script Modify settings.xml for the online repo Step 1: Make a backup of you settings.xml that is in .m2 by renaming to settings-bu.xml Step 2: Copy settings.xml from the support directory to the ./m2 directory This is to enable the online repo and add the S-RAMP username/password
  13. RED HAT CONFIDENTIAL | ADD NAME 17 Option 2: Use

    the Dockerfile for a docker container Eventually everything in the lab will be contained in a docker image. Contains Centos, and FSW 6.0.0.GA Dockerfile to build Docker image: https://github.com/JBoss-Dockerfiles/FSW600Base FSW admin redhat1! fswAdmin redhat1!
  14. RED HAT CONFIDENTIAL | ADD NAME 18 Docker Setup Step

    1: Install docker Instructions are located for each platform at https://docs.docker.com/ Step 2: Start docker sudo systemctl start docker Step 3: If you receive a operation not permitted error, try sudo chmod a+rw /var/run/docker.sock Step 4: Verify docker is running docker info or docker version Step 5A: Either load the tar image with docker load and go to step 8 or continue to 5B Step 5B: Clone the git repository git clone https://github.com/JBoss-Dockerfiles/FSW600Base.git Step 6: Download FSW from jboss.org and put the software into the software folder Step 7: Run the build command docker build -t jbossfsw600 . Step 8: Connect to the container docker run -P -i -t jbossfsw600 /bin/bash
  15. RED HAT CONFIDENTIAL | ADD NAME 19 Docker Setup (Continued)

    Step 9: Setup the server the same as the configuration steps in option 1 for FSW. Step 10: Start the processes in the container by running the run script /home/jboss/run.sh Step 11: Through another terminal get the IP, probably 172.17.0.2 -Get the ContainerID docker ps -Get the IP Address where MY_CID is the container ID docker inspect --format '{{ .NetworkSettings.IPAddress }}' MY_CID -Browse to FSW where MY_IP is the IP from above http://MY_IP:8080/
  16. RED HAT CONFIDENTIAL | ADD NAME 20 Additional helpful Docker

    Commands • Save an image to share docker save IMAGE > image.tar • Load an image from someone docker load IMAGE < image.tar • Stop all containers docker stop $(docker ps -a -q) • Delete all containers docker rm $(docker ps -a -q) • Delete all images docker rmi $(docker images -q)
  17. RED HAT CONFIDENTIAL | ADD NAME 21 A couple of

    notes around docker: 1. If you will use docker with the labs then that will impact lab2. Make sure to point to the S-RAMP repo in docker in maven. 2. When deploying straight to FSW through JBDS then you do a remote connection to the FSW Server in the container.
  18. RED HAT CONFIDENTIAL | ADD NAME 22 Setup JBoss Developer

    Studio for both Option 1 and Option 2 Step 1: Download JBoss Developer Studio (JBDS) 7.1.1 from https://www.jboss.org/products/devstudio/download/ Step 2: Install JBDS according to the instructions Step 3: Add the Integration Stack within JBDS through install new software http://download.jboss.org/jbosstools/updates/stable/kepler/integration-stack/ If step by step is required here send me a message and I will point you to specific info or assist you.