Skip to content

Instantly share code, notes, and snippets.

@obbyK
Created July 6, 2020 03:55
Show Gist options
  • Save obbyK/47700f69cf2418e51b00c478172c8ea9 to your computer and use it in GitHub Desktop.
Save obbyK/47700f69cf2418e51b00c478172c8ea9 to your computer and use it in GitHub Desktop.
package io.quarkus.test.hazelcast;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import io.quarkus.scheduler.Scheduled;
@ApplicationScoped
public class HazelcastServerTestResource {
@Inject
HazelcastInstance hazelcastClient;
public void connect(String key, String value) {
hazelcastClient.<String, String>getMap("TEST").put(key,value);
}
@Scheduled(every = "5s")
void testConnect() {
connect("test","test");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment