webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Tech Bytes IWHI: Push self hosted assets to external repository and pull them on webMethods.io Integration 

16 days ago

Introduction 

This article will explain how we can push the assets to external repository and pull them on webMethods.io Integration platform. 

Pre-requisite 

webMethods.io Integration tenant with Develop Anywhere and Deloy Anywhere capabilities enabled 

Audience 

 This article is targeted for Integration architects and developers of webMethods. 

Use case 

Client has developed the assets on self hosted setup in the past .Now client is  planning to move the assets to cloud and want to run them on cloud runtimes. 

Push the assets to external repository 

  • To pull the assets on the cloud we should first make sure these assets are available on external repository.
  • Create the external repository having same name as the package name.
  • All the dependency should be added to the package before it is pushed to external repository. 

        For example: if the package assets are using the JDBC adapter then the reference to same should be added to the                         dependencies. 

Note: Single package refers to single repository on the external version control system. 

Picture 

  • In our case we are using the kafka adapter. Therefore, we have added the dependency of WmkafkaAdapter. 

Picture 

  • Pushed the package to the external repository. In our case we are using Azure repository. 

 

Picture 

Notes: 

  • External repository name should be the same name as the name of package of Integration server.
  • Before we push the package to the external repository, All the dependency packages should be added on the package dependent. 

 Pull the assets from external repo 

  •  Version control should be configured on the platform so that we can pull the assets from external repo.
  • Navigate to the packages tab inside the project. 

 

Picture 

  • Click on Add package. 
  • Provide the clone URL for the package and click on next. 
  • Select the branch and pull the assets. 

 

Picture 

  • On successful pull we will have all the assets pulled with details like package version and the URL from where it has been pulled. 

Picture 

  • Now we can invoke these packages services by orchestrating them in the flow service or the workflow. 

Note: 

  • In case we want to expose the package services as API or want to orchestrate them in workflow then we should make package services as public before it is pushed to external repository.
  • If we have created the VCS project then only Deploy Anywhere assets will be pushed to the external repository. All the flowservices , workflow and assets associated with them will still reside in the internal repository.
  • Package name and the external repository name should be same.
  • If there are any jars use in the packages then those jar files should be explicitly imported under the libraries section of the webMethods project in package tab. 

Picture 

  • As all the packages pulled resides on cloud design time, therefore if we import the same packages in different projects in the backend it is single same package on design time. All the project eventually refers to same package. 
  • In my custom packages we are using the couple of services and some services are using connectors. All those connectors should be listed on connector page under Deploy Anywhere tab. In my case we are using the Kafka there we can see the Kafka connections under the Deploy Anywhere tab. 

 

Picture 

 

Automate the process of creating, updating and list of packages using API’s. 

 

Create package using API 

URL: https://<hostName>/apis/v1/rest/projects/<projectName>/configurations/packages 

METHOD: POST 

Request payload 

{ 

  "packageName": "CustomServices", 

  "gitServerName": "vikashazure", 

  "gitUserName": "VikashSharma5", 

  "gitBranch": "CustomServices" 

} 

 Response payload 

{ 

"output": { 

"message": "Package CustomServices updated successfully." 

} 

} 

 

Picture 

 

Update package using API 

URL: https://<hostName>/apis/v1/rest/projects/<projectName>/configurations/packages 

METHOD: PUT 

Request payload: 

{ 

  "projectPackageName": "LogisticAssetsProject", 

  "name": "CustomServices", 

  "gitServerName": "vikashazure", 

  "gitBranch": "CustomServices" 

} 

 

Response Payload 

{ 

"output": { 

"message": "Package CustomServices updated successfully." 

} 

} 

 

Picture 

 

Get the list of all the packages available in a project 

 

METHOD: GET 

URL: https://<hostName>/apis/v1/rest/projects/<projectName>/configurations/package 

Request Payload: NA 

Response payload

 

{ 

"output": [ 

{ 

"packageName": "CustomServices", 

"gitServerName": "vikashazure", 

"gitUserName": "VikashSharma5", 

"gitBranch": "CustomServices" 

} 

] 

} 

Inserting image..., Picture 

Statistics
0 Favorited
9 Views
0 Files
0 Shares
0 Downloads