WSO2 Developer’s Guide
上QQ阅读APP看书,第一时间看更新

Composite Application Project

Composite Application Project will be used to generate the deployable artifacts. This project is aware of the existing artifacts in the rest of the project within the workspace and allows us to choose which one we want to add to the deployable Carbon Application aRchive (CAR) file.

Once again, we go to the Developer Studio dashboard, click on the Composite Application Project and follow these steps:

  1. We enter the name and location of the project as we did earlier, in the other projects:
  1. Click on Next and add the Maven information: Group Id, Version, and Artifact Id.
  2. Click on Finish, and the project will be added to the Project Explorer:

Then, we are ready to generate our carbon file, which we will be able to deploy in our WSO2EI by following these steps:

  1. Double-click on the pom.xml file of the project; as shown in the following screenshot:
  1. In this window, we again have the Maven information we introduced when we created the project. The usual task on this screen is to select the artifacts we want to deploy. Here, we can see all the artifacts we have previously created, such as proxy, sequences, and endpoint.
  2. In this case, we select all of them but My1stDataServiceProject. As we said earlier, we need to go further into data services; the data service sample created to illustrate how to create Data Service Projects is not completed and will generate errors if we try to deploy it.

For the registry resources project, we need to change the server role. By default, as we can see in the preceding image, the registry resource artifacts have the server role Governance Registry. Since we are not working with the product WSO2 governance registry in this book, we have to choose the WSO2EI built-in registry. In other words, we have to set the EnterpriseServiceBus role for the artifacts of the Registry Resource Projects:

  1. We generate the deployable artifact by clicking on the icon in the top-right corner:
  1. We choose the location to save the file, for instance, in the carbonApp folder. We can check whether the *.car file has been created in the folder:

Once we have generated the car file, the next step is to deploy to the server. To do this, we follow these steps:

  1. Sign in to the WSO2EI management console.
  2. Go to Main | Carbon Applications | Add:
  1. Select the *.car file generated; in this case, My1stCompositeApplication_1.0.0.car:
  1. Clicking on Upload will show an upload confirmation message. We will need to go to the WSO2EI console to check whether the deployment was successfully completed or not:
  1. Additionally, if the carbon application is deployed successfully, we will see this application in the WSO2EI management console in the Main | Carbon Applications | List path:
  1. To undeploy the carbon application, we just click on the Delete action and it will be removed from the WSO2EI.