Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • Deloitte - Private
    • How-To
    • Accenture-Private
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by Avdhesh Chouhan · Mar 29, 2018 at 04:23 AM · cloud-foundry-cli

Deployment using Java CF CLI APIs Parallely

We have a REST end point /startDeployment/{CustomerA} which when executed for Customer A , do the following things :

Step 1. Create Space in Org

Step 2. Create Predix Services

Step 3. Deploy all the 5 micro-services

We are using the Java CF CLI APIs (cloud-foundry libraries) for this , like below :

  • org.cloudfoundry.client.lib.CloudFoundryClient

  • org.cloudfoundry.client.lib.CloudFoundryOperations

We are successfully able to deploy all 5 micro-services .

Now , the problem here is lets say , the deployment for Customer A is going on (lets say Executing Step 2) and now we try to do the deployment for Customer B ( /startDeployment/{CustomerA} ) in parallel .

The execution of the Customer A is then PAUSED and deployment of Customer B STARTS . Which causes conflicts .

Is there any way where we can have deployment using Java CF CLI APIs Parallely in more than one Space . ?

@Siva Balan

Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by Tom Turner · Mar 29, 2018 at 08:58 AM

It kind of sounds like the CF library has implemented some semaphore's because it's not thread safe.

Have you tried doing this in separate threads? For example, for your REST endpoint you pass in the variable {CustomerX}. Which seems like you are already doing that.

One way, if this is deployed to cloud foundry, is to create more instances. The load balancer will round robin and run in separate JVMs. Thus ensuring any library calls are not blocked by a 2nd thread.

Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Tip: deploying to CF after macOS Sierra update 2 Answers

Is there any CF CLI command to check the current runtime environment is DEA or DIEGO? [not the appwise checking command] 1 Answer

Getting an error when trying to download droplet for any app 2 Answers

Manifest.yml Error Pushing Predix Data Exchange app 2 Answers

cf create-user failed 1 Answer

GE Monogram
  • Legal
  • Cookies
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • Deloitte - Private
  • How-To
  • Accenture-Private
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests