Tuesday, February 16, 2016

WSO2 APP Manager - Multiple versioning support

How to configure WSO2 AppM to allow multiple version support

In WSO2 AppM applications can be accessed with and without app version mentioned in the URL.
Once an user publish an app as the default version, the particular app version can be accessed without specifying the version in the URL

eg:
Lets say I create a app with below details:

  • Provider: lahiru
  • App Name: myapp1
  • App Context: myapp1
  • Version: 1.0
  • Is default version: true

In this case, technically two synapse configuration xml's will be created (under wso2appm-home/repository/deployment/server/synapse-configs/default/api) as versioned and non versioned apis. (in this scenario it will be lahriu--myapp1.xml and lahriu--myapp1_1.0.xml)
and the non versioned configuration will keep the default version details, So once a request received without a version it will redirected to the versioned app.




Tips:
  • Non Versioned config will be only created if the published app is the default version (alone with the versioned config)
  • Once a non default app version is published, only the Versioned Config will be created
  • Once the default app version is unpublished/deleted Non Versioned config will be deleted alone with the Versioned config
  • Once a non default app version is unpublished/deleted Non Versioned config will be remain as it is while Versioned config will be removed.
Database details:
Version update will be maintained in APM_APP_DEFAULT_VERSION table.
When an app is created the default version will be stored in DEFAULT_APP_VERSION field and once it is published PUBLISHED_DEFAULT_APP_VERSION field will be updated.
(Publihser UI always refer the DEFAULT_APP_VERSION field when idenfifying default version while Store UI refers the PUBLISHED_DEFAULT_APP_VERSION field)


User Experience (Publisher) :

  • When you create a new application, you can define if it is the default version or not (select make as Default Version option)
  • User can create a new version of any App marking the new version as the default version. So when the new app get published, all the subscription to the original version will be copied to the newly published version.

  • User can also edit and mark any version of an existing App as the default version.


  • There can be only one published default version of an App.

User Experience (Store) :

There are two deployment options available:
  • Display all published versions 
  • Display only the default version
To do this need to open app-manager.xml file inside [wso2appm_home]/repository/conf/ directory
Change the 'DisplayMultipleVersions' property to true/false accordingly

If display all published versions is enabled, it will show all the versions available in store/search result and all sorting options. But if you select display only the default version option it will show only the default version of the App in all occurrences.





No comments:

Post a Comment