File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
sample/src/main/java/io/quarkiverse/infinispan/embedded/sample Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
package io .quarkiverse .infinispan .embedded .sample ;
2
2
3
+ import org .infinispan .protostream .GeneratedSchema ;
4
+ import org .infinispan .protostream .annotations .Proto ;
5
+ import org .infinispan .protostream .annotations .ProtoSchema ;
6
+
7
+ @ Proto
3
8
public record Greeting (String name , String message ) {
9
+ @ ProtoSchema (includeClasses = { Greeting .class })
10
+ public interface GameSchema extends GeneratedSchema {
11
+ }
4
12
}
Original file line number Diff line number Diff line change 9
9
10
10
import org .infinispan .Cache ;
11
11
import org .infinispan .commons .api .CacheContainerAdmin ;
12
+ import org .infinispan .commons .dataconversion .MediaType ;
12
13
import org .infinispan .configuration .cache .CacheMode ;
13
14
import org .infinispan .configuration .cache .Configuration ;
14
15
import org .infinispan .configuration .cache .ConfigurationBuilder ;
16
+ import org .infinispan .health .ClusterHealth ;
15
17
import org .infinispan .manager .EmbeddedCacheManager ;
16
18
17
19
import io .quarkus .logging .Log ;
@@ -28,13 +30,19 @@ public class InfinispanGreetingResource {
28
30
@ Startup
29
31
void init () {
30
32
Configuration config = new ConfigurationBuilder ()
33
+ .encoding ().mediaType (MediaType .APPLICATION_PROTOSTREAM )
31
34
.clustering ().cacheMode (CacheMode .DIST_ASYNC ).build ();
32
35
Log .info ("Create mycache with config " + config );
33
36
cacheManager .administration ()
34
37
.withFlags (CacheContainerAdmin .AdminFlag .VOLATILE )
35
38
.getOrCreateCache (CACHE_NAME , config );
36
39
}
37
40
41
+ @ GET
42
+ public ClusterHealth clusterHealth () {
43
+ return cacheManager .getHealth ().getClusterHealth ();
44
+ }
45
+
38
46
@ POST
39
47
@ Path ("/{id}" )
40
48
public CompletionStage <String > postGreeting (String id , Greeting greeting ) {
You can’t perform that action at this time.
0 commit comments