Infinispan communication using rest when values are placed using Hotrod - rest

scenario : in Infinispan 5.3 server , application putting value in cache using Hotrod(address1:port) , but not able to get same value using infinispan rest interface(using same address1:port and same key).
e.g. put "x"="y" in infinispan cache using hotrod . trying to fetch same cached value using address1:port/rest/cachename/x but not able to get value.
Please provide input as I am new to it, also please provide example if any.

In order to store data via one interface (e.g. HotRod) and retrieve it via a different interface (e.g. REST), you need to enable compatibility/interoperability mode.

Related

Setting a traceId with an existing value in Spring Sleuth

We have an application and where we are tracing the whole logs using a custom correlation header i.e. X-CID with a value as for example, 615b7eea-6d4c-4efb-9431-fcbba084ea3f. Recently we have integrated the Spring Sleuth with the train version as Greenwich.BUILD-SNAPSHOT in our application and using brave's Span and tracer to create trace and span ad sending it to Zipkin.
What we are looking for a mechanism where we can use or set the CID value as a traceId rather than using the auto generated one from Sleuth.
The rational behind is, we would like to make it uniform CID value to use or search in Zipkin UI rather than two different values i.e. CID value and Spring Sleuth traceId to trace the complete API calls.
Please note that, we would like to reuse the X-CID from request which is already supplied in the request header.
Are there any APIs to override this behavior or any alternate way to achieve this ?

getAll() method of Infinispan shows wrong hit miss count

I have downloaded infinispan 7.2.5 version and created a simple server in a cluster mode. I have placed it in a jboss folder(locally) and started the server. I have created a simple client that puts the data into the cache and another client that gets the data from the cache in eclipse.
what I have observed is in a cluster mode when I fetch single value that is not present into the cache, using getAll() method, getHits method give me 1 count (Ideally it should have been miss 1) also when I try to get a value which is already present into the cache, getHits method shows count as 2.
Also in a standalone environment when i fetched a single value from cache using getAll() method which is not present I get getMisses() method count as 1 (which is expected) but again in standalone mode also when I try to get a single value which is present in cache I get getHits method count as 2.
This is really confusing me as why this is happening. while other get() methods of infinispan behave in an expected way. This seems to happens only with getAll() method.
why is this happening?

Using visjs manipulation to create workflow dependencies

We are currently using visjs version 3 to map the dependencies of our custom built workflow engine. This has been WONDERFUL because it helps us to visualize the flow and find invalid or missing dependencies. What we want to do next is simplify the process of building the dependencies using the visjs manipulation feature. The idea would be that we would display a large group of nodes and allow the user to order them correctly. We then want to be able to submit that json structure back to the server for processing.
Would this be possible?
Yes, this is possible.
Vis.js dispatches various events that relate to user interactions with graph (e.g. manipulations, or position changes) for which you can add handlers that modify or store the data on change. If you use DataSets to store nodes and edges in your network, you can always use the DataSets' get() function to retrieve all elements in you handler in JSON format. Then in your handler, just use an ajax request to transmit the JSON to your server to store the entire graph in your DB or by saving the JSON as a file.
The oppposite for loading the graph: simply query the JSON from your server and inject it into the node and edge DataSets' using the set method.
You can also store the networks current options using the network's getOptions method, which returns all applied options as json.

how to display a (at least partial) list of keys in Hazelcast using REST

I know that it is possible to display the value of a key that is part of a Map that was stored in hazelcast using REST.
Using curl this would be done this way:
curl -v -X GET http://127.0.0.1:5701/hazelcast/rest/maps/myMap/nameOfKeyInMap
But what if I don't know which keys were used ? Following REST principles I skipped the nameOfKeyInMap part of the URL and expected Hazelcast to return a list of keys. But it didn't.
Do you know a way to get at least a part of the keys used ? I use Hazelcast 3.4 and checked the manual but didn't find a solution
I want to use REST because I need to have people check the maps that don't have much more than a browser on their computers.

Creating regions in Memcache using java

I just installed memcache in my machine.Actually,i have to create regions in there.
For eg there should be 3 regions created ,each storing a set of data.Am not sure how can i do that in memcache.Can anyone please help/give eg as it is "urgent".
Thanks in advance
Memcached itself is just a service that runs on your server. It can be connected to and commands sent to it over a text based protocol. Once the service is running, you can use a tool such as telnet or netcat to interact with it.
As for accessing from Java, you'll probably want a library to do most of the work for you. There were a few listed on this question: Java Memcached Client
Now as for your regions: memchached is basically a key/value table. To set a region you'd do something like memcached.set("key", yourData) and to get it back you'd do something like yourData = memcached.get("key")
Note that these functions will vary depending which library you are using.