Well, according to the GemFire documenation, your Gfsh put
command appears to be correct...
put --key=1 --value=('exchange':'xyz','Product':'abc','Account':'xyz','Quantity':'123L') --region=/trade --value-class=model.TradeDetails
However, your key
value 1
is a bit suspect. If you used a key constraint of java.lang.Long
on your "/trade" Region then you also need to specify the --key-class
option on the put
.
I was able to successfully perform the following...
$ gfsh
_________________________ __
/ _____/ ______/ ______/ /____/ /
/ / __/ /___ /_____ / _____ /
/ /__/ / ____/ _____/ / / / /
/______/_/ /______/_/ /_/ v8.2.0
Monitor and Manage GemFire
gfsh>connect
Connecting to Locator at [host=localhost, port=10334] ..
Connecting to Manager at [host=10.99.199.3, port=1099] ..
Successfully connected to: [host=10.99.199.3, port=1099]
gfsh>list members
Member Count : 1
Coordinator : SpringGemFireDataServer (10.99.199.3(SpringGemFireDataServer:77179)<v0>:47312)
Name | Id
----------------------- | ----------------------------------------------------
SpringGemFireDataServer | 10.99.199.3(SpringGemFireDataServer:77179)<v0>:47312
gfsh>describe member --name=SpringGemFireDataServer
Name : SpringGemFireDataServer
Id : 10.99.199.3(SpringGemFireDataServer:77179)<v0>:47312
Host : 10.99.199.3
Regions : People
PID : 77179
Groups :
Used Heap : 229M
Max Heap : 3641M
Working Dir : /Users/jblum/pivdev/spring-data-gemfire-tests-workspace/spring-data-gemfire-tests/target
Log file : /Users/jblum/pivdev/spring-data-gemfire-tests-workspace/spring-data-gemfire-tests/target
Locators : localhost[10334]
Cache Server Information
Server Bind : localhost
Server Port : 40404
Running : true
Client Connections : 0
gfsh>list regions
List of regions
---------------
People
gfsh>describe region --name=/People
..........................................................
Name : People
Data Policy : partition
Hosting Members : SpringGemFireDataServer
Non-Default Attributes Shared By Hosting Members
Type | Name | Value
------ | ---- | -----
Region | size | 0
gfsh>
gfsh>put --region=/People --key=1 --key-class=java.lang.Long --value=('firstName':'Jon','lastName':'Doe') --value-class=org.spring.data.gemfire.app.beans.Person
Result : true
Key Class : java.lang.Long
Key : 1
Value Class : org.spring.data.gemfire.app.beans.Person
Value
------
<NULL>
gfsh>
gfsh>describe region --name=/People
..........................................................
Name : People
Data Policy : partition
Hosting Members : SpringGemFireDataServer
Non-Default Attributes Shared By Hosting Members
Type | Name | Value
------ | ---- | -----
Region | size | 1
Note, my "/People" Region has a key type of java.lang.Long
and value type of org.spring.data.gemfire.app.beans.Person
.
Although, when I attempted to read "Jon Doe" back out, Gfsh puked...
gfsh>get --region=/People --key=1 --key-class=java.lang.Long --value-class=org.spring.data.gemfire.app.beans.Person
Exception occurred. null
However, I did go onto create a (Spring Boot-based) GemFire client cache application (with a base configuration of SpringGemFireClient) that pulled the Person back out successfully.
Person is [Jon Doe]
You might try annotating your model.TradeDetails
application domain type with the Jackson mapping annotations, though I am not certain Gfsh actually uses them to perform the mapping since I think (when I lasted checked) Gfsh was not using Jackson. But, it wouldn't hurt either. Either way.
Note, my Server was started with this SpringGemFireDataServer, which is based on SpringGemFireServer.
Hope this helps (a little :-).
Cheers!
John