After packaging artifacts into a Composite Application, you can deploy it to the server using the Tooling interface.
Alternatively, you can also do this using one of the following options:
Before you begin, package your artifacts into a Composite Application. Note that the examples here are given using WSO2 ESB, but the steps are the same for any WSO2 server.
You need to give the same name, which you gave for the artifact in the artifacts.xml
file of the Composite Application.
Deploying using the Tooling interface
If you have already added a WSO2 product server instance to Tooling, right click on it in the Servers tab, and click Add and Remove...
Then, select the Composite Application you want to deploy from the Available list, click Add to move it into the Configured list, and then click Finish.
In the Tooling interface, navigate to Developer Studio Dashboard, and click Server under Add Server.
- In the Define a New Server dialog box, expand the WSO2 folder and select the version of your server. In this case, it is
WSO2 ESB Server 5.0.0
. - Click Next. In the CARBON_HOME field, provide the path to your product's home directory and then click Next again. For example,
Review the default port details for your server and click Next.
Typically, you can leave these unchanged but if you are already running another server on these ports, give unused ports here.Tip: See Default Ports of WSO2 Products for more information.
To deploy the C-App project to your server, select SampleServicesCompositeApplication from the list, click Add to move it into the Configured list, and then click Finish.
Note that your server is now added to the Tooling interface.
On the Servers tab, note that the server is currently stopped. Click the "start the server" icon on the Servers tab's toolbar. If prompted to save changes to any of the artifact files you created earlier, click Yes.
As the server starts, the Console tab appears. Note messages indicating that the Composite app was successfully deployed. The C-App is now available in the product's Management Console, under Manage -> Carbon Applications -> List.
If you want to remove a Composite Application, which you already deployed, click the WSO2 product server instance in the Servers tab to expand it, right-click on the Composite Application, which you want to remove, and click Remove as shown below.
If you do not use the Tooling interface to deploy your artifacts to the server, you can alternatively do that using the product's Management Console or via hot deployment.
Deploying via the product's Management Console
You can also deploy a C-App via the product's Management Console. To do this you will first need to create a CAR file and then deploy the created CAR file as follows:
Click the Main tab on the Management Console, go to Manage -> Carbon Applications and then click Add.
The Add Carbon Applications screen appears.
Click Choose File, select your CAR file and click Upload.
The CAR files that you upload are dropped to the<PRODUCT_HOME>/tmp/carbonapps/{tenant-ID}/
directory.Refresh the browser to see that the CAR file has been deployed.
Click the Main tab on the Management Console, go to Manage -> Carbon Applications and then click List. If successfully deployed, the CAR file appears here.
It is not recommended to use the Management Console to edit the artifacts that have been deployed to your server using a CAR file.
Deploying via hot deployment
You can deploy a C-App by d irectly saving it to the <
PRODUCT_HOME>/repository/deployment/server/carbonapps
directory. If you are running products in a cluster, use the Deployment Synchronizer to keep the configurations on all nodes of the cluster in sync.
Deploying using the Maven plug-in
Open the
pom.xml
file of the Composite Application Project. In the Source view, search formaven-car-deploy-plugin
under the<plugins>
element and edit the<trustStorePath>
so that it points to the actual location within the product folder structure. See below for an example:<plugin> <groupId>org.wso2.maven</groupId> <artifactId>maven-car-deploy-plugin</artifactId> <version>1.1.1</version> <extensions>true</extensions> <configuration> <carbonServers> <CarbonServer> <trustStorePath>/Users/Gillian/ESB/wso2esb-5.0.0/repository/resources/security/wso2carbon.jks</trustStorePath> <trustStorePassword>wso2carbon</trustStorePassword> <trustStoreType>JKS</trustStoreType> <serverUrl>https://localhost:9443</serverUrl> <userName>admin</userName> <password>admin</password> <operation>deploy</operation> </CarbonServer> </carbonServers> </configuration> </plugin>
Using command prompt, navigate to the ESB Config Project folder and build the project using the following command:
mvn clean install
If you have more than one project bundled in your C-App project, you need to build each of those projects using the above command.
Build and deploy the Composite Application Project using one of the following:
Open the
pom.xml
file of the Composite Application Project. In the Source view, add the following line in the<properties>
section:<maven.car.deploy.skip>true</maven.car.deploy.skip>
OR
Using command prompt, navigate to the Composite Application Project folder and use the following command:
mvn clean deploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false
When you access the ESB management console, you can see the artifacts in your Composite Application Project are deployed to your ESB server.
When you deploy a Composite Application, the ESB artifacts are deployed in the below order.
- Local entries
- Endpoints
- Sequences
- Message stores
- Templates
- Proxy services
- Tasks
- Events
- Message processors
- APIs
- Inbound endpoints
- Other types
When deleting a C-App, it is not recommended to delete individual artifacts of the CAR file. The recommended practice is to delete the entire C-App.
You can delete a C-App from the Management Console or by deleting the CAR archive from <PRODUCT_HOME>/repository/carbonapps/{tenant-ID}
. {tenant-ID}
is 0 in a single-tenant environment as 0 is the super tenant ID. Manual undeployment in a multi-tenanted environment is not recommended if you are unaware of the tenant ID.