Server apps can face issues when executing server side listener method (onStartAppMigration
)
and stop with an exception. We have seen cases where such server side failures caused the migrations of several apps to expire,
as their cloud apps were not aware of server side failure and had not updated their transfer status to a settled state
within 14-day time period.
This feature is available for app migrations using CCMA v3.3.7 and JCMA v1.7.2 onwards.
Your cloud app will be notified with webhook event of type listener-errored
(Connect) or a Forge event of type avi:ecosystem.migration:errored:listener
(Forge) when the execution of your server side listener
method onStartAppMigration
has stopped with an uncaught exception.
For Forge migrations, the event will also include details such as the type of exception and stack trace to facilitate easier debugging.
onStartAppMigration
,
we recommend your cloud app to update the transfer status to a meaningful settled status based on
data received so far from your server app.When implementing exception handling in your server-side listener method, choose the appropriate approach based on your needs:
This approach is recommended when you encounter fatal errors that should halt the migration process entirely.
1 2public void onStartAppMigration(AppCloudMigrationGateway gateway, String transferId, MigrationDetailsV1 migrationDetails) { try { // Your migration logic } catch (Exception e) { // Do your own logging of the exception to help with debugging log.error("Exception occurred in onStartAppMigration", e); // Do any cleanup if needed throw e; // Rethrow the exception to let the platform know about the exception } }
This allows the app migration platform to automatically emit the listener-errored
event to your cloud app.
This approach is useful when you want to:
1 2public void onStartAppMigration(AppCloudMigrationGateway gateway, String transferId, MigrationDetailsV1 migrationDetails) { try { // Your migration logic } catch (Exception e) { // Use the app data upload mechanism to send exception details to your cloud app OutputStream firstDataStream = gateway.createAppData(transferId); firstDataStream.write(e.toString().getBytes()); firstDataStream.close(); // Don't rethrow the exception here } }
Rate this page: