Lesson 4.3: Update the service rankings

Complete this lesson to update current service rankings that you queried.

About this task

Procedure

  1. Update the service rankings of the services, myShardListener and myProtoBufSerializer, to service ranking 2. The service ranking list is passed in using -sr option.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to update the service rankings:
      ./xscmd.sh -c osgiUpdate -g Grid -ms MapSet -sr "myShardListener;2,myProtoBufSerializer;2" 
      The following output is displayed:
      Update succeeded for the following service rankings:
      Service              Ranking
      -------              -------
      myProtoBufSerializer 2
      myShardListener      2
      
      CWXSI0040I: The command osgiUpdate has completed successfully.
      The following output is displayed on the OSGi console:
      SystemOut O MyShardListener@326505334(version=2.0.0) order
      com.ibm.websphere.samples.xs.serializer.proto.DataObjects2$Order$Builder@
      22342234(34) updated
      Notice that the MyShardListener service is now version 2.0.0, which has service ranking 2.
  2. Run the xscmd command to query the current service ranking for all services that are used by the ObjectGrid named Grid and the map set named MapSet.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query the service rankings for all services that are used by Grid and MapSet:
      ./xscmd.sh -c osgiCurrent -g Grid -ms MapSet 
      The following output is displayed:
      OSGi Service Name    Current Ranking ObjectGrid Name MapSet Name Server Name
      -----------------    --------------- --------------- ----------- -----------
      myProtoBufSerializer 2               Grid            MapSet      collocatedServer
      myShardListener      2               Grid            MapSet      collocatedServer
      
      CWXSI0040I: The command osgiCurrent has completed successfully.

Results

Lesson checkpoint

In this lesson, you updated the service rankings for services myShardListener and myProtoBufSerializer.

.