Redeploy New Microservice Source

Redeploy New Microservice Source

  1. Open Command Prompt, Execute the below command to go to the directory where the IDE code is located and to create and switch to the new branch
cd C:\Users\Administrator\git\dev-tripsearch
git checkout -b "new-implementation"

Redeploy New Microservice Source

  1. Download file project TripSearchFromCity.zip and extract
  2. In the Eclipse IDE, right-click on the root element of the dev-tripsearch project
  • Click Show In
  • Click System Explorer. Redeploy New Microservice Source
  1. Delete the folder src and the folder target of the project dev-tripsearch
  • Copy the contents of the TripSearchFromCity project over to the dev-tripsearch project we open in the step 3
  • Click Replate the file in the destination
  1. In the Eclipse IDE, right-click on the root element of the dev-tripsearch project
  • Click Maven
  • Click Update Project Redeploy New Microservice Source
  1. In the Eclipse IDE, right-click on the root element of the dev-tripsearch project
  • Click Run As
  • Click Run Configurations… Redeploy New Microservice Source
  1. right-click on JUnit
  • Click New Configuration Redeploy New Microservice Source
  1. Select tab Environment
  • Click Add
  • In the Name section, type DDB_TABLENAME_TRIPSECTOR
  • In the Value section, type TravelBuddyTripSectors
  • Click OK
  • Click Run Redeploy New Microservice Source
  1. We will recieve the following result Redeploy New Microservice Source

If there are errors, there are a couple of likely causes:

  • The name of the DynamoDB table you created does not match the source code definition. Check that the name you used for the table was TravelBuddyTripSectors and this is the same text that you set for the DDB_TABLENAME_TRIPSECTOR environment variable.
  • The region the source code is targeting is not the same region where you created the DynamoDB table. In this case, check with a Lab Assistant regarding which region you should be using, and check that you have created the table in the right region. Also check that the source code is referring to the same region, in the DynamoDBManager class:
private DynamoDBManager() {

    ...

    //
    // Construct our DynamoDB client - note the REGION must match your lab region
    //
    AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
        .withRegion(Regions.AP_SOUTHEAST_2)
        .withCredentials(credentialsProvider)
        .build();

    ...
}