Chapter 2. Deploying your Services to the ESB

In the previous chapter we learned some basics about how to set up JBoss ESB in conjunction with JBoss AS. In this chapter we'll go a little deeper and start to learn what you can do with the JBoss ESB deployed to the server you have just configured.

In this chapter you will:

  • Learn about the core components of JBoss ESB, how they work, and what it means for your services.
  • Get hands on with a sample application, one of the JBoss ESB quickstarts. Using this quickstart as a live example, you'll explore deploying and administering services.
  • Learn how to develop, deploy, and administer your services by using the eclipse-based JBoss Developer Studio.

The quickstarts

In this section we'll examine the "quickstart" example programs that are packaged with JBoss ESB. You'll find these in the /samples/quickstarts directory of the JBoss ESB installation.

For a writer starting a new assignment, facing a blank piece of paper (or word processing screen) can be an intimidating prospect. As a programmer, facing a blank editor or IDE window can be an equally intimidating prospect when you are learning a new technology. It's common for software development packages to make learning a new technology easier by including a few examples, but these can be either too small or too simple to illustrate key concepts, or may combine so many features into a single example that it becomes confusing.

JBoss ESB takes a different approach with its "quickstart" example programs. There are a large number of individual quickstarts, each of which illustrates one or more JBoss ESB features. It is also an explicit goal of the quickstarts for them to be usable both as educational examples and as the starting point for your own custom applications. As the name "quickstart" indicates, these programs are intended to give you an understanding of JBoss ESB and help you build your own applications quickly. At the time of this writing, there are over 80 quickstarts included with JBoss ESB in the samples/quickstarts directory. These quickstarts demonstrate JBoss ESB features such as listeners, routing, data transformations with JBoss Smooks, JBoss ESB integrations with JBoss jBPM and JBoss Rules, and many other features.

While they all demonstrate different features and technologies, the quickstarts share some common characteristics in that they are all built, deployed, and run with a small number of simple Apache Ant commands. The quickstarts also include a readme file that explains the features that each quickstart demonstrates, as well as the steps to run the quickstart. Note that each quickstart includes its own ant build.xml file. These ant files are used to define quickstart-specific tasks. A common build task file (this file is named samples/quickstarts/conf/base-build.xml) is used to define tasks common to all the quickstarts, such as quickstart deployment.

For the most part, you can run the JBoss project software with no changes after a download, but the quickstarts require you to define some environmental variables. While each quickstart includes its own build.xml ant file, all the quickstarts make use of a set of common environmental variables. As a prerequisite before you run any quickstart, you have to configure these common variables. The quickstarts expect these variables to be defined in a file named quickstarts.properties. The easiest way to set these variables' values is by copying the file in the samples/quickstarts directory named quickstarts.properties-examples to quickstarts.properties and then editing the quickstarts.properties file you just created to set the variables to match your server configuration.

The environment variables are as follows:

  • org.jboss.esb.server.home: Set this to the home directory of your JBoss AS server installation. In the case of the configuration that we are using in this book, this would be set to /opt/jboss-5.1.0.GA.
  • org.jboss.esb.server.config: Set this to the server profile to which JBoss ESB has been deployed. In the case of the configuration that we are using in this book, this would be set to all.
  • jbpm.console.username and jbpm.console.password: These two variables are used by the jBPM-related quickstarts. Both of these should be set to "admin" unless you have defined security settings different from the out-of-the-box configuration. Obviously, "admin/admin" is not a very secure username and password for a production. We'll talk about the options that JBoss ESB supports for production level password security later in the book in Chapter7. For now, we'll keep things simple and stick with "admin/admin".
  • jbossesb.ftp.hostname, jbossesb.ftp.username, jbossesb.ftp.password, and jbossesb.ftp.directory: Some of the quickstarts demonstrate aspects of JBoss ESB's support for the FTP protocol (for example, the FTP gateway listener), so you will have to define these environment variables to be able to have your services access an FTP server.

Additionally, the quickstarts all have one more thing in common; whether they are small or large, they are all fully-functioning and deployable JBoss ESB applications. You can take any of them and use it as a starting point to develop your own custom application. A great way to begin is to take a quickstart, make some small changes, deploy it, verify that it works as intended, then rinse and repeat, and extend it. We'll build, deploy, and run a quickstart later in this chapter. Later, in Chapter 4, we'll extend a quickstart.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.36.249