ameruddin jamil
ameruddin jamil

Reputation: 155

WSO2 EI Deploy Updated Artifact

I have a question regarding WSO2 EI Deployment. Here is the scenario, I had create 4 API for my project.

For the first time deployment. I generated 1 CApp file consist of 4 API and other artifact such as endpoint, resources and java project

CappFile.1.0.0.car
-- FirstApi
-- SecondApi
-- ThirdApi
-- FourthApi

It was running perfectly and everything works fine. In the next weeks for example. the SecondApi need to be enhanced a bit in the flow. In the Capp pom.xml I only choose to deploy the SecondApi

CappFile.1.0.0.car
-- SecondApi

When I deployed the CappFile.1.0.0.car this time, it will override/delete the FirstApi, ThirdApi and FourthApi in the system.

I though need to change the name/versioning of the .car file. My second approach was

CappFile.1.0.1.car
-- SecondApi

When I deployed this time, the console prompt me an error that Duplicate resource definition by the name: SecondApi.

How do you guys handle this kind of situation ? Or do I need to include everything in my .car file every time I need to perform a deployment even though others API does not have any changes ?

UPDATE

There is an option to Package a single artifact into deployable archives. Link. I manage to package the SecondApi into deployable archives which is SecondApi.xml.

But where do I need to upload the XML file ? They never mentioned anything in the documentation.

Please help !

Upvotes: 1

Views: 419

Answers (1)

ophychius
ophychius

Reputation: 2653

When you redeploy a CAR file the EI will effectively delete the old CAR files contents and replace them with the new CAR files contents. If your CAR file contains 4 API's and you update one but don't want to delete the others the new file will have to again contain all 4 API's.

Secondly, it replaces CAR files and their contents based on the name. So if you create a different CAR file it will not replace the first. When it then wants to deploy the 'SecondAPI' this already exists and will not be replaced.

If you want to deploy your API's separately you should create a CAR file for each of your API's and it's corresponding files (sequences, registry items etc).

If there is a dependency between a group of API's and you decide they should be part of the same CAR file they will always be redeployed when you update one of them via the CAR file.

If you choose a different way to update your API which was deployed using a CAR file it will revert to it's original state (from the CAR file) upon server restart.

There is no straight forward way to deploy the individually packaged artifacts.

Upvotes: 2

Related Questions