Products
Clients
Extensions
APIs
This guide will walk you through creating and testing a VMware GemFire service instance on the Tanzu Application Service (TAS) using a Hello, World! client application.
Hello, World!
Starting in a terminal
Run cf login, and create or target your organization’s space.
cf login
Run cf marketplace -s p-cloudcache to list your available VMware GemFire plans. Take note of the service plan as this will be your <PLAN-NAME> in the following step. Note that VMware GemFire was previously called Pivotal Cloud Cache).
cf marketplace -s p-cloudcache
service plan
<PLAN-NAME>
Create a VMware GemFire service instance within the space with the following command:
cf create-service p-cloudcache <PLAN-NAME> <SERVICE-INSTANCE-NAME>
<SERVICE-INSTANCE-NAME>
The <SERVICE-INSTANCE-NAME> can include alpha-numeric characters, hyphens, and underscores. This is also the name you will use in your manifest.yml to bind your client application to the service instance.
manifest.yml
If successful you will see
OK
Create in progress. Use 'cf services' or 'cf service <your-service-name>' to check operation status.
Confirm the VMware GemFire service instance has been created by running
$ cf services
This command outputs the current status of the service instance creation. In the last operation column you will either see create in progress if it is still be created or create succeeded when it is ready to be used.
create in progress
create succeeded
It can take several minutes for the service instance creation to complete.
Within your org, create a space or navigate to the space that will hold your VMware GemFire service instance.
Click on the Services tab.
Click on the ADD A SERVICE button.
Click on VMware GemFire.
Choose one of the available plans and click SELECT PLAN.
Fill in the Instance Name with a custom name for your service instance. The service instance name can include alpha-numeric characters, hyphens, and underscores. This is the name you will use in your manifest.yml. (Alternatively, if you have already pushed your application to your space can select it in the “Bind to App” dropdown - however we prefer to bind our applications through a manifest.yml file)
Click CREATE
After clicking create you will see VMware GemFire service instance provisioning begin and in the Last Operation column it will say create in progress.
Once complete you will see create succeeded under the Last Operation column (you may need to refresh the page for the status to update).
This section will guide you through testing a Hello, World! client application on the Tanzu Application Service to confirm that your VMware GemFire service instance is set up correctly.
Clone the Hello, World! app from the examples repo.
$ git clone https://github.com/gemfire/spring-for-gemfire-examples.git
manifest.yaml
spring-for-gemfire-examples/hello-world
manifest.yml file
<your-gemfire-for-tas-service-instance-name>
cf services
hello-world
./gradlew build
cf push
The cf push operation will bind the Hello,World! app to the VMware GemFire service instance named in your manifest.yaml file and then start the app.
When the app is up and running, the cf push command should output information about the app in the terminal. One of the fields listed will be the route. In a browser copy and paste the route from cf push.
route
route from cf push
You should see something similar to the below, which represents an artificial time delay simulating a database query.
key: hello value: 2019-10-01T16:17:51.557 (this will be your current date & time) time to look up: 3057ms (quantity of time that it took to acquire the key-value pair).
key: hello
value: 2019-10-01T16:17:51.557 (this will be your current date & time)
time to look up: 3057ms (quantity of time that it took to acquire the key-value pair).
Refresh the page and you should see something similar to
key: hello value: 2019-10-01T16:17:51.557 (this will be your current date & time) time to look up: 6ms (quantity of time that it took to acquire the key-value pair).
time to look up: 6ms (quantity of time that it took to acquire the key-value pair).
Note that the time to look up has been significantly reduced. This represents the app getting the information from the cache, VMware GemFire, instead of querying the database.
There are two ways to delete the app and the VMware GemFire service instance
cf delete helloworld -r -f
cf delete-service <SERVICE-INSTANCE-NAME>
Congratulations! You’re ready to start using VMware GemFire. You will need to create a new VMware GemFire Service Instance when working with your own application.
Now that you have successfully created a running VMware GemFire service instance, check out some other guides.