Giter Site home page Giter Site logo

hazelcast-code-samples's Introduction

Hazelcast Code Samples Readme

The folder /code-samples in your package contains an extensive collection of code samples which you can use to learn how to use Hazelcast features. From distributed primitives to Service Provider Interface (SPI), you can see Hazelcast in action readily.

How to run

If the sample has a README file, follow the instructions. A lot of samples have shell scripts like "start.sh", "start-member.sh" or "start-client.sh", use them to run the sample. If none of the previous options apply, use java -cp target/classes:target/lib/* to run the sample.

Included sample folders

  • /clients — Includes sample code that shows how to create a Hazelcast client, put a message on a queue by this client and receive that message by a Hazelcast node. Further how to set up client's near cache, deploy user code to member, communicate via REST or populate client statistics to member.
  • /cluster — cluster state managements and shutdown
  • /cluster-split-brain-protection — setting up cluster split brain protection programatically
  • /cluster-split-brain-protection-xml — setting up cluster split brain protection via XML configuration
  • /cluster-state — managing cluster state to frozen, passive and shutdown.
  • /demo — You can start multiple nodes and operate usual map operations using the code samples here.
  • /distributed-collections — Includes Distributed Queue, Bounded Queue, Listeners, Set, List, Queue store, Ringbuffer and Ringbuffer store code samples.
  • /distributed-executor — examples of distributed task execution e.g. executing on all member, just key owner, only lite nodes only, on specific member. Also examples of usage of futures and scheduled executions.
  • /distributed-map — An extensive code samples folder that includes many features of the Hazelcast distributed map in action.
  • /distributed-primitives — Includes Distributed AtomicLong, AtomicReference, CountDownLatch, IdGenerator, FlakeIdGenerator, CardinalityEstimator, Condition, Semaphore and Lock code samples.
  • /distributed-topic — Code samples to see publish/subscriber messaging model.
  • /enterprise — Includes socket and security interceptor, CPMap, HD store and hot restart code samples.
  • /hazelcast-integration — Code samples to show how you can integrate Hazelcast with Hibernate 2nd Level Cache and Spring. It also includes code samples for web session replication and resource adapter implementation.
  • /jcache — An extensive code samples folder for operations including creating a cache and writing entries to it, creating listeners and clients.
  • /jet — Code samples to demonstrate building stream and batch processing applications using Hazelcast's Jet engine.
  • /jmx — example of connecting to Hazelcast member via JMX.
  • /json — examples of JSON objects stored in Hazelcast.
  • /learning-basics — Code samples to show some Hazelcast basics like creating, configuring and destroying Hazelcast instances, configuring logging and Hazelcast configuration.
  • /monitoring — Includes code samples that show how to check if a Hazelcast cluster is safe to be shutdown.
  • /near-cache — Shows the benefits of Near Caches, local subsets of data that track the master copy in the grid. Further extends the /clients examples.
  • /network-configuration — Shows what options Hazelcast configuration has regarding to network (e.g. partition grouping, multicast, ports, outbound ports, etc.)
  • /osgi — Demonstrates how to use Hazelcast's OSGI support
  • /replicated-map — Code samples to show how to get a replicated map and create an entry listener.
  • /serialization — Includes code samples that implement various serialization interfaces like DataSerializable, IdentifiedDataSerializable, Externalizable and Portable. It also has code samples to show how to plug a custom serializer using StreamSerializer and ByteArraySerializer interfaces and usage of Kryo and Protobuf serializers.
  • /spi — Includes code samples that create a simple counter application using Hazelcast’s Service Provider Interface (SPI).
  • /sql — Examples of using SQL directly, or via JDBC.
  • /transactions — Code samples showing how to use the TransactionalMap and TransactionalTask interfaces.

Included helper folders

  • /checkstyle — Java code style configuration
  • /helper — Shared utility classes and methods for samples

hazelcast-code-samples's People

Contributors

alparslanavci avatar arodionov avatar bilalyasar avatar cangencer avatar dbrimley avatar dependabot[bot] avatar devopshazelcast avatar donnerbart avatar emrahkocaman avatar esrefozturk avatar frant-hartm avatar googlielmo avatar gregrluck avatar hasancelik avatar jackpgreen avatar jerrinot avatar kwart avatar lazerion avatar ldziedziul avatar mdogan avatar mmedenjak avatar mustafaiman avatar neilstevenson avatar noctarius avatar olukas avatar pveentjer avatar ramizdundar avatar tomaszgaweda avatar vbekiaris avatar viliam-durina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hazelcast-code-samples's Issues

Management Center

Hello
I add Management Center to monitor Hazelcast in Kuberenetes, but the Management Center does not recognize the Hazelcast members, what should I do?

The Hazelcast client from the Spring Boot/Eureka code samples does not work

Had an attempt to use the samples provided here: https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/springboot-eureka-partition-groups.
Everything goes well, meaning the hazelcast servers register correctly within eureka server, the eureka client works fine, but my-hazelcast-client app is not able to find any of the service instances registered within Eureka. The last logged line from this client is:

discoverNodes(): Hazelcast lookup to Eureka: start

While debugging, I see that:

my-eureka-client is autowiring a org.springframework.cloud.netflix.eureka.EurekaDiscoveryClient containing as eurekaClient a org.springframework.cloud.netflix.eureka.CloudEurekaClient object
my-hazelcast-client (the faulty one) gets a com.sun.proxy.$Proxy object with toString() returning "Collecting data...".

Can you help?

RingbufferStore does not support byte[] as type parameter.

public void storeAll(long firstItemSequence, byte[][] items) {

Version:

3.4.11 ( Although I just checked the 4.x code and it has the same problem )

Description:

When implementing a RingbufferStore<byte[]> as in the example, when storeAll is invoked it will fail with a ClassCastException. This is because the RingbufferStoreWrapper converts the data into an Object array before trying to call the main RingBufferStore. An Object[] cannot be cast into an byte[][] so it fails to properly cast the data.

Example:

public class SimpleRingBufferStore implements RingbufferStore<byte[]>
{
  public void store(final long sequence, final byte[] data) {}
  public void storeAll(long firstItemSequence, byte[] [] items) {}
  public byte[] load(long sequence) { return new byte[0]; }
  public long getLargestSequence() { return 0L; }
}

var hazelcastInstance = ... // configure with ring buffer store and binary mode
var ringbuffer = hazelcastInstance .getRingbuffer("test_ringbuffer");

// This will fail internally
ringbuffer.addAllAsync(asList("A", "B", "C"), OverflowPolicy.FAIL)
   .get();

// This will work
ringbuffer.add("A");
ringbuffer.add("B");
ringbuffer.add("C");


Solution:

The solution seems to be change it to RingBufferStore<Object> and then casting it internally.

variable-replacers does not compile anymore

It happens in two different computers:

  • Windows 10
  • Ubuntu 18.04

For a clean installation:

  • Git: cloned, fetch

Through Maven for the hazelcast-code-samples root project through either:

  • mvn compile
  • mvn dependency:resolve compile
  • mvn clean dependency:resolve compile

Now appears:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:33 min
[INFO] Finished at: 2020-04-29T10:54:37-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project variable-replacers: Compilation failure: Compilation failure: 
[ERROR] /C:/blueroom/sts-workspace-hazelcast-code-samples/hazelcast-code-samples/variable-replacers/src/main/java/com/hazelcast/sample/replacer/ExecReplacer.java:[30,1] cannot find symbol
[ERROR]   symbol:   static UTF8_CHARSET
[ERROR]   location: class
[ERROR] /C:/blueroom/sts-workspace-hazelcast-code-samples/hazelcast-code-samples/variable-replacers/src/main/java/com/hazelcast/sample/replacer/ExecReplacer.java:[154,51] cannot find symbol
[ERROR]   symbol:   variable UTF8_CHARSET
[ERROR]   location: class com.hazelcast.sample.replacer.ExecReplacer.StdStreamReader
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :variable-replacers

00

Days ago it worked, now not.

The following is weird, because it appears in the class declaration but not in the Outline view

01

I cleaned and re-builded 3 times in the two computers and same behavior.

Not sure what happened

Unable to run ocp-demo-frontend in OpenShift

Openshift version used:
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth

kubernetes v1.11.0+d4cacc0

After executing oc new-app --image-stream=ocp-demo-frontend --name=hazelcast-client-app step, Pod is failing for below exception.

2020-02-18 11:04:57.525  WARN 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultMapService': Unsatisfied dependency expressed through field 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/hazelcast/ocp/configuration/KubernetesConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.NoClassDefFoundError: com/hazelcast/util/StringUtil
--
  | 2020-02-18 11:04:57.529  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
  | 2020-02-18 11:04:57.547  INFO 1 --- [           main] utoConfigurationReportLoggingInitializer :
  | Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
  | 2020-02-18 11:04:57.555 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application startup failed
  | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultMapService': Unsatisfied dependency expressed through field 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/hazelcast/ocp/configuration/KubernetesConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.NoClassDefFoundError: com/hazelcast/util/StringUtil
  | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
  | at com.hazelcast.ocp.OcpDemoApplication.main(OcpDemoApplication.java:16) [classes!/:na]
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
  | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
  | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
  | at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
  | at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [ocp-demo-frontend-0.1-SNAPSHOT.jar:na]
  | at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [ocp-demo-frontend-0.1-SNAPSHOT.jar:na]
  | at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [ocp-demo-frontend-0.1-SNAPSHOT.jar:na]
  | at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [ocp-demo-frontend-0.1-SNAPSHOT.jar:na]
  | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [com/hazelcast/ocp/configuration/KubernetesConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.NoClassDefFoundError: com/hazelcast/util/StringUtil
  | at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:325) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | ... 27 common frames omitted
  | Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.NoClassDefFoundError: com/hazelcast/util/StringUtil
  | at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | ... 37 common frames omitted
  | Caused by: java.lang.NoClassDefFoundError: com/hazelcast/util/StringUtil
  | at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy.readProperty(HazelcastKubernetesDiscoveryStrategy.java:131) ~[hazelcast-kubernetes-1.0.0.jar!/:na]
  | at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy.getOrDefault(HazelcastKubernetesDiscoveryStrategy.java:115) ~[hazelcast-kubernetes-1.0.0.jar!/:na]
  | at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy.getOrNull(HazelcastKubernetesDiscoveryStrategy.java:106) ~[hazelcast-kubernetes-1.0.0.jar!/:na]
  | at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy.<init>(HazelcastKubernetesDiscoveryStrategy.java:53) ~[hazelcast-kubernetes-1.0.0.jar!/:na]
  | at com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategyFactory.newDiscoveryStrategy(HazelcastKubernetesDiscoveryStrategyFactory.java:56) ~[hazelcast-kubernetes-1.0.0.jar!/:na]
  | at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.buildDiscoveryStrategy(DefaultDiscoveryService.java:183) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.loadDiscoveryStrategies(DefaultDiscoveryService.java:141) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.<init>(DefaultDiscoveryService.java:57) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.spi.discovery.impl.DefaultDiscoveryServiceProvider.newDiscoveryService(DefaultDiscoveryServiceProvider.java:29) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.impl.clientside.ClusterDiscoveryServiceBuilder.initDiscoveryService(ClusterDiscoveryServiceBuilder.java:246) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.impl.clientside.ClusterDiscoveryServiceBuilder.build(ClusterDiscoveryServiceBuilder.java:99) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl.initClusterDiscoveryService(HazelcastClientInstanceImpl.java:285) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl.<init>(HazelcastClientInstanceImpl.java:242) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.HazelcastClient.constructHazelcastClient(HazelcastClient.java:458) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.HazelcastClient.newHazelcastClientInternal(HazelcastClient.java:416) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.client.HazelcastClient.newHazelcastClient(HazelcastClient.java:119) ~[hazelcast-all-4.0.jar!/:4.0]
  | at com.hazelcast.ocp.configuration.KubernetesConfig.hazelcastInstance(KubernetesConfig.java:19) ~[classes!/:na]
  | at com.hazelcast.ocp.configuration.KubernetesConfig$$EnhancerBySpringCGLIB$$9058cd8b.CGLIB$hazelcastInstance$0(<generated>) ~[classes!/:na]
  | at com.hazelcast.ocp.configuration.KubernetesConfig$$EnhancerBySpringCGLIB$$9058cd8b$$FastClassBySpringCGLIB$$c3d54798.invoke(<generated>) ~[classes!/:na]
  | at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | at com.hazelcast.ocp.configuration.KubernetesConfig$$EnhancerBySpringCGLIB$$9058cd8b.hazelcastInstance(<generated>) ~[classes!/:na]
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
  | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
  | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
  | at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
  | at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
  | ... 38 common frames omitted
  | Caused by: java.lang.ClassNotFoundException: com.hazelcast.util.StringUtil
  | at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_151]
  | at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_151]
  | at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94) ~[ocp-demo-frontend-0.1-SNAPSHOT.jar:na]
  | at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_151]
  | ... 65 common frames omitted

Enterprise builds include hazelcast-all & hazelcast-enterprise.

Exception in thread "main" java.lang.IllegalArgumentException: DataSerializableFactory[-45] is already registered! com.hazelcast.journal.EventJournalDataSerializerHook$1@2f177a4b -> com.hazelcast.internal.journa

Looking into the target directory I find both:
-rw-r--r-- 1 terrywalters staff 10175254 May 29 12:30 hazelcast-all-3.9-SNAPSHOT.jar
-rw-r--r-- 1 terrywalters staff 12237193 May 29 12:30 hazelcast-enterprise-all-3.11-SNAPSHOT.jar

Which causes the aforementioned exception.

com.hazelcast.samples:helper:jar:0.1-SNAPSHOT missing from repos - build fails

Where can this be found?

<dependency>
    <groupId>com.hazelcast.samples</groupId>
    <artifactId>helper</artifactId>
    <version>0.1-SNAPSHOT</version>
</dependency>

The recursive Maven build fails without it:

[INFO] Reactor Summary:
[INFO] 
[INFO] DistributedMap ..................................... SUCCESS [ 24.842 s]
[INFO] Aggregations ....................................... SUCCESS [  0.018 s]
[INFO] DistributedMap - Backup ............................ SUCCESS [  0.874 s]
[INFO] DistributedMap - Basics ............................ SUCCESS [  0.167 s]
[INFO] DistributedMap - Continuous Query .................. SUCCESS [  0.177 s]
[INFO] DistributedMap - Criteria API ...................... SUCCESS [  0.140 s]
[INFO] DistributedMap - Custom Attributes ................. SUCCESS [  0.018 s]
[INFO] DistributedMap - Data Locality ..................... SUCCESS [  0.113 s]
[INFO] DistributedMap - EntryListener ..................... SUCCESS [  0.112 s]
[INFO] DistributedMap - EntryProcessor .................... SUCCESS [  0.111 s]
[INFO] DistributedMap - Eviction .......................... SUCCESS [  0.134 s]
[INFO] DistributedMap - Hashcode and equals ............... SUCCESS [  0.098 s]
[INFO] DistributedMap - In Memory Format .................. SUCCESS [  0.082 s]
[INFO] DistributedMap - Index ............................. SUCCESS [  0.195 s]
[INFO] DistributedMap - Locking ........................... SUCCESS [  0.106 s]
[INFO] DistributedMap - MapInterceptor .................... SUCCESS [  0.094 s]
[INFO] DistributedMap - MapStore .......................... SUCCESS [ 19.207 s]
[INFO] DistributedMap - Multimap .......................... SUCCESS [  0.072 s]
[INFO] DistributedMap - Near Cache ........................ FAILURE [  0.526 s]
[INFO] DistributedMap - PagingPredicate ................... SKIPPED
[INFO] DistributedMap - MapPartitionLostListener .......... SKIPPED
[INFO] DistributedMap - Query Collections and Arrays ...... SKIPPED
[INFO] DistributedMap - SqlQuery .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.288 s
[INFO] Finished at: 2016-12-14T16:32:56-05:00
[INFO] Final Memory: 39M/581M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project near-cache: Could not resolve dependencies for project com.hazelcast.samples.distributed-map:near-cache:jar:0.1-SNAPSHOT: Could not find artifact com.hazelcast.samples:helper:jar:0.1-SNAPSHOT in snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]

More sample code

Hi
i think hazelcast docs and even this sample app are lacking the explanation of how to configure the cache in terms of LRU Time to leave etc. eventually i understood that i define a map and its name is the cache name - but that was just a hunch.
also you need to add some more programmatic ways to cache and evict code, specially with spring-cache
as i mentioned injecting the cacheManager then getCache(mapName) and the be able to put/get on it.

what i mean is that an example with only Cacheable("city") is not enough to understand the connection between spring and hazelcast map.

thanks you have a wonderful product.

Shlomi

Client for SpringBootEmbedded

You have given three examples of creating a hazelcast cluster in eureka namely hazelcast-only, hazelcast-separate-client, hazelcast-metadata at - (hazelcast-code-samples/hazelcast-integration/eureka/springboot-embedded/

I have created such a cluster (of type hazelcast-metadata). The cluster works fine. Now I am trying to create a Hazelcast client application that should push a message on a hazelcast queue on the cluster. I am not able to do that. Can you provide us with a example or pointer on how to write a client application that talks to hazelcast cluster on eureka?

The example client application would use com.hazelcast:hazelcast-client and not com.hazelcast:hazelcast.

Failure on Java 11 but not on Java 8

Some samples fail on Java 11 but work on Java 8.

For example, https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/eureka

$ java --version
openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
$ 
$ java -jar eureka-server/target/eureka-server-0.1-SNAPSHOT.jar 
2020-03-13 21:10:20.552  INFO 6457 --- [           main] o.s.core.annotation.AnnotationUtils      : Failed to introspect annotations on class org.springframework.cloud.netflix.eureka.config.EurekaDiscoveryClientConfigServiceBootstrapConfiguration: java.lang.IllegalStateException: Could not obtain annotation attribute value for public abstract java.lang.Class[] org.springframework.boot.autoconfigure.condition.ConditionalOnClass.value()
2020-03-13 21:10:20.568  INFO 6457 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5dda768f: startup date [Fri Mar 13 21:10:20 CET 2020]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/Users/neil/code/hazelcast-code-samples/hazelcast-code-samples/hazelcast-integration/eureka/springboot-embedded/eureka-server/target/eureka-server-0.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-5.0.10.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-03-13 21:10:20.835  INFO 6457 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2020-03-13 21:10:20.887  INFO 6457 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$f1e79a81] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.6.RELEASE)

2020-03-13 21:10:21.106  INFO 6457 --- [           main] c.hazelcast.samples.eureka.EurekaServer  : No active profile set, falling back to default profiles: default
2020-03-13 21:10:21.132  INFO 6457 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@446a1e84: startup date [Fri Mar 13 21:10:21 CET 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@5dda768f
2020-03-13 21:10:22.267  INFO 6457 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=d26dbf61-e324-3988-9d12-b1b83bebcdbd
2020-03-13 21:10:22.299  INFO 6457 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2020-03-13 21:10:22.437  INFO 6457 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$f1e79a81] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-13 21:10:22.927  INFO 6457 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8761 (http)
2020-03-13 21:10:22.957  INFO 6457 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-03-13 21:10:22.957  INFO 6457 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.34
2020-03-13 21:10:22.969  INFO 6457 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/neil/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2020-03-13 21:10:23.071  INFO 6457 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-03-13 21:10:23.071  INFO 6457 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1939 ms
2020-03-13 21:10:23.322  WARN 6457 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-03-13 21:10:23.322  INFO 6457 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-03-13 21:10:23.340  INFO 6457 --- [ost-startStop-1] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@7335317e
2020-03-13 21:10:24.378  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2020-03-13 21:10:24.378  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpTraceFilter' to: [/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'servletContainer' to urls: [/eureka/*]
2020-03-13 21:10:24.379  INFO 6457 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2020-03-13 21:10:24.516  INFO 6457 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl           : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2020-03-13 21:10:24.611 ERROR 6457 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Exception starting filter [servletContainer]

java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
	at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]
	at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]
	at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
	at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]
	at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]
	at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
	at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]
	at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]
	at java.base/java.lang.Class.getGenericInterfaces(Class.java:1137) ~[na:na]
	at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:629) ~[jersey-core-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:625) ~[jersey-core-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.core.spi.factory.ContextResolverFactory.getParameterizedType(ContextResolverFactory.java:202) ~[jersey-core-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.core.spi.factory.ContextResolverFactory.init(ContextResolverFactory.java:89) ~[jersey-core-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1332) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) ~[jersey-core-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) ~[jersey-server-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:744) ~[jersey-servlet-1.19.1.jar!/:1.19.1]
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:112) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[na:na]
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) ~[eureka-server-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
	at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
	at java.base/java.lang.Class.forName(Class.java:398) ~[na:na]
	at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[na:na]
	... 36 common frames omitted

Other samples may be affected also, I've not tried them all.

On Spring Boot 2.2.5, this https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-with-Java-9-and-above suggests to add this (version from spring-boot-starter-parent)

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
        </dependency>

spring-data-jpa-hazelcast-migration mvn clean compile error

when i run hazelcast-code-samples-master/hazelcast-integration/spring-data-jpa-hazelcast-migration demo
use mvn clean error it return below errors:

Downloaded from snapshot-repository: https://oss.sonatype.org/content/repositories/snapshots/com/hazelcast/hazelcast-all/4.0-SNAPSHOT/hazelcast-all-4.0-20190821.081924-277.jar (12 MB at 1.8 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spring Data JPA to Hazelcast 0.1-SNAPSHOT .......... SUCCESS [ 0.102 s]
[INFO] Spring Data JPA to Hazelcast (Shared utilities) .... FAILURE [ 20.196 s]
[INFO] Spring Data JPA to Hazelcast (RDBMS database) ...... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" domain) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" JPA repo) ... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" JPA service) SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" main) ....... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before") ............ SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" domain) ...... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" JPA repo) .... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" JPA service) . SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" KV repo) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" KV service) .. SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" HZ main) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" main) ........ SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After") 0.1-SNAPSHOT SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.725 s
[INFO] Finished at: 2019-08-22T22:44:06+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project shared: Could not resolve dependencies for project com.hazelcast.samples.spring.data.migration:shared:jar:0.1-SNAPSHOT: Could not find artifact com.hazelcast.samples:helper:jar:0.1-SNAPSHOT in snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :shared

Hazelcast Tomcat web session replication

Hi, I try to test Hazelcast-filter based session replication, But it doesn't work, on failover it doesn't retain the cookie of other server.
Do we need to set any tomcat configurations?

Improve some learning-basics code samples

Following code samples in learning-basics should be improved to be more readable and understandable:

  • destroying-instances - I suggest to rename this code sample to destroying-distributed-object
  • unique-names - there is missing some description about what is the point of this code samples. Even if code includes just a 3 lines it is quite confusing. Some explanation would be useful.
  • wildcard-configuration - there is missing some description about what is the point of this code samples. There should be probably mentioned that wildcard is used in xml configuration.

502 Bad gateway: Hazelcast Management Center via GCE Ingress

For those of you who will be exposing Hazelcast Management Center (MC) via Google's Ingress GCE controller - be aware that GCE Ingress is expecting a working (should be 200 OK) readiness probe from the Service backing the MC Deployment.

I tried with the defaults and got 502 Bad gateway when accessing the exposed MC service. You can read about similar experience here.

Note also, that the default endpoint /hazelcast-mancenter returns 302 Found, which is ok for the readiness probe, but apparently not for GCE Ingress. The quick hack would be to use either /hazelcast-mancenter/index.html or /hazelcast-mancenter/. But in the long term I would propose to implement a dedicated health probe, e.g. /health or /healthz, etc.

So 302 Found is ok for checking the readiness of the Service, but if you check the status of the ingress, you will probably see the UNHEALTHY status:

k describe ing mc-ingress
Name:             mc-ingress
Namespace:        default
Address:          34.98.YYY.2
Default backend:  mc-service:8080 (10.52.2.23:8080)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *     *     mc-service:8080 (10.52.2.23:8080)
Annotations:  
  ingress.kubernetes.io/backends:  {"k8s-be-32517--47d3253409234a5d":"UNHEALTHY"}
Events:                            <none>

Here is a working yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mc-volume
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mc
  labels:
    app: hazelcast
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hazelcast
  template:
    metadata:
      labels:
        app: hazelcast
    spec:
      containers:
        - name: mc
          image: hazelcast/management-center
          resources:
            limits:
              memory: 1Gi
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /hazelcast-mancenter/
              port: 8080
          readinessProbe:
            httpGet:
              path: /hazelcast-mancenter/
              port: 8080
          volumeMounts:
            - name: mc-storage
              mountPath: /data
      volumes:
        - name: mc-storage
          persistentVolumeClaim:
            claimName: mc-volume
---
apiVersion: v1
kind: Service
metadata:
  name: mc-service
spec:
  type: NodePort
  selector:
    app: hazelcast
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mc-ingress
  labels:
    app: hazelcast
spec:
  backend:
    serviceName: mc-service
    servicePort: 8080

P.S. Nginx Ingress doesn't have such issue. But a dedicated health endpoint is a nice to have non the less.

Spark Integration Code Sample Failure

The directory of HazelcastJavaRDD has been changed, so it cannot be imported from current address.

The config parameter of SparkConfig, "hazelcast.server.address" is invalid.

The instructions for building before executing the sample applications are needed to be added on readme.

Unify the execution in code-samples

Find a way to unify how the code samples are executed.

There are some general instructions for executing samples in the readme.html, but they are not sufficient for all user kinds. They are targeting advanced/experienced users.

What can go wrong with current structure:

  • it's confusing when some samples have bash scripts included and other don't have
  • samples don't have Windows scripts, it can look like it's targeting just a Un*x audience

Suggestion to improvement:
Avoid using shell scripts and provide README files for all samples.
The READMEs could do the better job than the bash scripts. They should work for Windows users too.

Another improvement could be to employ maven exec plugin, so users would do just mvn java:exec. There still would be a need to list the main classes available in the sample in the README.

This issue is related to #188 (instructions how to build the samples).

Simplify and unify hazelcast-code-samples

I would like to open discussion about simplifying and unifying code samples. The idea behind is to provide unified experience to users and allow QE to verify the samples in a CI job.

Suggested improvements:

  • use one main class per sample and unify its name across the samples (e.g. Main.java), so the maven-exec-plugin can be configured in the parent POM and users can use mvn exec:java in each sample
  • shut down the whole cluster at the end of each sample
  • remove shell scripts - the maven-exec-plugin shall be used instead (lets provide README.md where necessary)
  • use System.out to print what the samples do
    • it will allow to introduce basic test automation in Jenkins

We should also think about slimming down the samples - i.e. find candidates for a removal. We have 214 modules with 312 main classes included now. Such amount is not easy to maintain. I would prefer to have 100 main classes at most.

Comments and suggestions for other improvements are welcome.

ocp-demo-frontend code sample doesn't compile on JDK9

Building code samples on JDK9 results in the following:

[INFO] Compiling 9 source files to /home/jenkins/hazelcast-code-samples/hazelcast-integration/openshift/client-apps/ocp-demo-frontend/target/classes
java.lang.NoSuchFieldError: members_field
	at lombok.javac.handlers.JavacHandlerUtil.fixMethodMirror(JavacHandlerUtil.java:962)
	at lombok.javac.handlers.JavacHandlerUtil.injectMethod(JavacHandlerUtil.java:953)
	at lombok.javac.handlers.HandleConstructor.generateConstructor(HandleConstructor.java:242)
	at lombok.javac.handlers.HandleBuilder.handle(HandleBuilder.java:158)
	at lombok.javac.HandlerLibrary$AnnotationHandlerContainer.handle(HandlerLibrary.java:109)
	at lombok.javac.HandlerLibrary.handleAnnotation(HandlerLibrary.java:244)
	at lombok.javac.JavacTransformer$AnnotationVisitor.visitAnnotationOnType(JavacTransformer.java:87)
	at lombok.javac.JavacNode.traverse(JavacNode.java:120)
	at lombok.javac.JavacAST.traverseChildren(JavacAST.java:143)
	at lombok.javac.JavacNode.traverse(JavacNode.java:83)
	at lombok.javac.JavacAST.traverseChildren(JavacAST.java:143)
	at lombok.javac.JavacNode.traverse(JavacNode.java:78)
	at lombok.javac.JavacAST.traverse(JavacAST.java:139)
	at lombok.javac.JavacTransformer.transform(JavacTransformer.java:71)
	at lombok.javac.apt.LombokProcessor.process(LombokProcessor.java:294)
	at lombok.core.AnnotationProcessor$JavacDescriptor.process(AnnotationProcessor.java:114)
	at lombok.core.AnnotationProcessor.process(AnnotationProcessor.java:164)
	at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.process(AnnotationProcessor.java:74)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:968)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:884)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1206)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1315)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1246)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
	at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:171)
	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:886)
	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Sample Code ........................................ SUCCESS [ 15.896 s]
[INFO] Clients ............................................ SUCCESS [  4.553 s]
[INFO] Clients - Basic .................................... SUCCESS [ 11.109 s]
[INFO] Hazelcast EE code sample helper classes ............ SUCCESS [  0.413 s]
[INFO] DistributedMap ..................................... SUCCESS [  0.010 s]
[INFO] DistributedMap - Near Cache ........................ SUCCESS [  0.321 s]
[INFO] Client Near Cache .................................. SUCCESS [  0.275 s]
[INFO] Clients - Rest Client .............................. SUCCESS [ 26.804 s]
[INFO] client-statistics .................................. SUCCESS [  0.174 s]
[INFO] user-code-deployment ............................... SUCCESS [  0.023 s]
[INFO] user-code-deployment-member ........................ SUCCESS [  0.133 s]
[INFO] user-code-deployment-client ........................ SUCCESS [  0.159 s]
[INFO] Cluster ............................................ SUCCESS [  4.113 s]
[INFO] Cluster Quorum ..................................... SUCCESS [ 11.246 s]
[INFO] Cluster Quorum sample for queue and lock with XML configuration SUCCESS [  0.279 s]
[INFO] Cluster State ...................................... SUCCESS [  0.194 s]
[INFO] Demo ............................................... SUCCESS [  0.554 s]
[INFO] Distributed Collections ............................ SUCCESS [  0.012 s]
[INFO] Distributed Collections - BlockingQueue ............ SUCCESS [  0.132 s]
[INFO] Distributed Collections - Bounded BlockingQueue .... SUCCESS [  0.157 s]
[INFO] Distributed Collections - Item Listeners ........... SUCCESS [  0.255 s]
[INFO] Distributed Collections - List ..................... SUCCESS [  0.265 s]
[INFO] Distributed Collections - QueueStore ............... SUCCESS [  0.287 s]
[INFO] Distributed Collections - RingbufferStore .......... SUCCESS [  0.240 s]
[INFO] Distributed Collections - Ringbuffer ............... SUCCESS [  0.288 s]
[INFO] Distributed Collections - Set ...................... SUCCESS [  0.215 s]
[INFO] Distributed Executor ............................... SUCCESS [  0.049 s]
[INFO] Distributed Executor - Basic Executor .............. SUCCESS [  0.218 s]
[INFO] Distributed Executor - Durable Executor Service .... SUCCESS [  0.218 s]
[INFO] Distributed Executor - Scheduling on key owner durable SUCCESS [  0.162 s]
[INFO] Distributed Executor - Scheduling on specific member SUCCESS [  0.137 s]
[INFO] Distributed Executor - Scheduling named task ....... SUCCESS [  0.168 s]
[INFO] Distributed Executor - Scheduling stateful task .... SUCCESS [  0.395 s]
[INFO] Distributed Executor - Scheduled Executor retrieve lost future SUCCESS [  0.264 s]
[INFO] Distributed Executor - Scheduled Executor Service retrieve all tasks SUCCESS [  0.143 s]
[INFO] Distributed Executor - Executing on all members .... SUCCESS [  0.161 s]
[INFO] Distributed Executor - Executing on key owner ...... SUCCESS [  0.135 s]
[INFO] Distributed Executor - Executing on lite members ... SUCCESS [  0.132 s]
[INFO] Distributed Executor - Executing on specific member  SUCCESS [  0.127 s]
[INFO] Distributed Executor - Execution Callback .......... SUCCESS [  0.121 s]
[INFO] Distributed Executor - Futures ..................... SUCCESS [  0.125 s]
[INFO] Distributed Executor - Scale Out ................... SUCCESS [  0.145 s]
[INFO] Distributed Executor - Scale Up .................... SUCCESS [  0.138 s]
[INFO] Aggregations ....................................... SUCCESS [  0.163 s]
[INFO] DistributedMap - Backup ............................ SUCCESS [  0.154 s]
[INFO] DistributedMap - Basics ............................ SUCCESS [  0.133 s]
[INFO] DistributedMap - Continuous Query .................. SUCCESS [  0.139 s]
[INFO] Continuous Query Cache (CQC) ....................... SUCCESS [  1.393 s]
[INFO] DistributedMap - Criteria API ...................... SUCCESS [  0.184 s]
[INFO] DistributedMap - Custom Attributes ................. SUCCESS [  0.290 s]
[INFO] DistributedMap - Data Locality ..................... SUCCESS [  0.204 s]
[INFO] DistributedMap - EntryListener ..................... SUCCESS [  0.168 s]
[INFO] DistributedMap - EntryProcessor .................... SUCCESS [  0.224 s]
[INFO] DistributedMap - Eviction .......................... SUCCESS [  0.201 s]
[INFO] DistributedMap - Hashcode and equals ............... SUCCESS [  0.131 s]
[INFO] DistributedMap - In Memory Format .................. SUCCESS [  0.170 s]
[INFO] DistributedMap - Index ............................. SUCCESS [  0.239 s]
[INFO] DistributedMap - Locking ........................... SUCCESS [  0.179 s]
[INFO] DistributedMap - MapInterceptor .................... SUCCESS [  0.110 s]
[INFO] DistributedMap - MapStore .......................... SUCCESS [ 30.282 s]
[INFO] DistributedMap - Multimap .......................... SUCCESS [  0.109 s]
[INFO] DistributedMap - PagingPredicate ................... SUCCESS [  0.127 s]
[INFO] DistributedMap - MapPartitionLostListener .......... SUCCESS [  0.108 s]
[INFO] DistributedMap - Query Collections and Arrays ...... SUCCESS [  0.119 s]
[INFO] DistributedMap - SqlQuery .......................... SUCCESS [  0.120 s]
[INFO] Fast Aggregations .................................. SUCCESS [  0.141 s]
[INFO] Fast Aggregations .................................. SUCCESS [  0.148 s]
[INFO] Distributed Primitives ............................. SUCCESS [  0.025 s]
[INFO] Distributed Primitives - IAtomicLong ............... SUCCESS [  0.102 s]
[INFO] Distributed Primitives - IAtomicLong Functions ..... SUCCESS [  0.108 s]
[INFO] Distributed Primitives - IAtomicReference .......... SUCCESS [  0.087 s]
[INFO] Distributed Primitives - CardinalityEstimator ...... SUCCESS [  0.147 s]
[INFO] Distributed Primitives - Condition ................. SUCCESS [  0.095 s]
[INFO] Distributed Primitives - CountdownLatch ............ SUCCESS [  0.121 s]
[INFO] Distributed Primitives - IdGenerator ............... SUCCESS [  0.121 s]
[INFO] Distributed Primitives - FlakeIdGenerator .......... SUCCESS [  0.115 s]
[INFO] Distributed Primitives - PNCounter ................. SUCCESS [  0.139 s]
[INFO] Distributed Primitives - Lock ...................... SUCCESS [  0.118 s]
[INFO] Distributed Primitives - Semaphore ................. SUCCESS [  0.108 s]
[INFO] Distributed Topic .................................. SUCCESS [  0.020 s]
[INFO] Distributed Topic - Basic Pub Sub .................. SUCCESS [  0.145 s]
[INFO] Distributed Topic - Reliable Topic ................. SUCCESS [  0.101 s]
[INFO] Distributed Topic - Scaling ........................ SUCCESS [  0.116 s]
[INFO] Enterprise ......................................... SUCCESS [ 10.704 s]
[INFO] Client SSL ......................................... SUCCESS [  0.202 s]
[INFO] Enterprise - HD IMap ............................... SUCCESS [  0.231 s]
[INFO] Enterprise - HD Memory Client / Server ............. SUCCESS [  0.027 s]
[INFO] hd-memory-examples-server .......................... SUCCESS [  4.288 s]
[INFO] hd-memory-examples-client .......................... SUCCESS [  6.967 s]
[INFO] jcache ............................................. SUCCESS [  3.133 s]
[INFO] Enterprise - HiDensity Cache ....................... SUCCESS [  1.337 s]
[INFO] Hot Restart ........................................ SUCCESS [  0.280 s]
[INFO] Enterprise - Security Interceptor .................. SUCCESS [  0.165 s]
[INFO] Enterprise - Socket Interceptor .................... SUCCESS [  0.237 s]
[INFO] Enterprise - Wan Replication ....................... SUCCESS [ 42.125 s]
[INFO] hazelcast-integration .............................. SUCCESS [  0.021 s]
[INFO] amazon-ec2-vagrant-chef ............................ SUCCESS [  0.147 s]
[INFO] amazon-elasticbeanstalk ............................ SUCCESS [01:12 min]
[INFO] Hazelcast Dynacache Integration Example ............ SUCCESS [02:03 min]
[INFO] Scaling Hazelcast IMDG cluster with Docker-Compose . SUCCESS [  9.028 s]
[INFO] Hazelcast Filter Based Session Replication ......... SUCCESS [  0.499 s]
[INFO] Hibernate 2nd Level Cache .......................... SUCCESS [ 29.105 s]
[INFO] Hibernate JPA 2nd Level Cache ...................... SUCCESS [ 26.560 s]
[INFO] Hazelcast JCA Example .............................. SUCCESS [ 12.100 s]
[INFO] Manager Based Session Replication Example .......... SUCCESS [  0.903 s]
[INFO] hazelcast-mongodb-integration-sample ............... SUCCESS [  3.998 s]
[INFO] openshift .......................................... SUCCESS [  0.023 s]
[INFO] client-apps ........................................ SUCCESS [  0.024 s]
[INFO] ocp-entry-processor ................................ SUCCESS [  0.140 s]
[INFO] ocp-demo-frontend .................................. FAILURE [01:30 min]
[INFO] pcf-integration .................................... SKIPPED
[INFO] Spark Connector Example ............................ SKIPPED
[INFO] Spring Cache Manager Example ....................... SKIPPED
[INFO] Hazelcast Spring Configuration Example ............. SKIPPED
[INFO] Spring Data Hazelcast Chemistry Parent (pom) ....... SKIPPED
[INFO] Spring Data Hazelcast Chemistry common (jar) ....... SKIPPED
[INFO] Spring Data Hazelcast Chemistry server (jar) ....... SKIPPED
[INFO] Spring Data Hazelcast Chemistry client (jar) ....... SKIPPED
[INFO] Spring Data Integration ............................ SKIPPED
[INFO] Spring Data JPA to Hazelcast ....................... SKIPPED
[INFO] Spring Data JPA to Hazelcast (Shared utilities) .... SKIPPED
[INFO] Spring Data JPA to Hazelcast (RDBMS database) ...... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" domain) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" JPA repo) ... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" JPA service)  SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before" main) ....... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("Before") ............ SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" domain) ...... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" JPA repo) .... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" JPA service) . SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" KV repo) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" KV service) .. SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" HZ main) ..... SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After" main) ........ SKIPPED
[INFO] Spring Data JPA to Hazelcast ("After") ............. SKIPPED
[INFO] Spring Hibernate 2nd Level Cache Example ........... SKIPPED
[INFO] spring-jcache ...................................... SKIPPED
[INFO] hazelcast-spring-security-sample ................... SKIPPED
[INFO] Spring Transaction Manager Example ................. SKIPPED
[INFO] springaware-annotation ............................. SKIPPED
[INFO] Spring Boot: Hazelcast via Spring Caching Abstraction SKIPPED
[INFO] Spring Boot: Hazelcast via Spring JCache ........... SKIPPED
[INFO] Partition Groups with Eureka ....................... SKIPPED
[INFO] Partition Groups with Eureka (Common) .............. SKIPPED
[INFO] Partition Groups with Eureka (Eureka Server) ....... SKIPPED
[INFO] Partition Groups with Eureka (Eureka Client) ....... SKIPPED
[INFO] Partition Groups with Eureka (Hazelcast Server) .... SKIPPED
[INFO] Partition Groups with Eureka (Hazelcast Client) .... SKIPPED
[INFO] Spring Boot: Hazelcast for Session Replication ..... SKIPPED
[INFO] Spring Boot: HTTP Session Analysis ................. SKIPPED
[INFO] Spring Boot: HTTP Session Analysis: Common ......... SKIPPED
[INFO] Spring Boot: HTTP Session Analysis: Client ......... SKIPPED
[INFO] Spring Boot: HTTP Session Analysis: Server ......... SKIPPED
[INFO] Tricolor ........................................... SKIPPED
[INFO] JCache 1.1 ......................................... SKIPPED
[INFO] JCache:1.1: Times Table ............................ SKIPPED
[INFO] Times Table: Common ................................ SKIPPED
[INFO] Times Table: Server ................................ SKIPPED
[INFO] Times Table: JCache with Spring .................... SKIPPED
[INFO] Times Table: JCache standard style, no Spring ...... SKIPPED
[INFO] jmx ................................................ SKIPPED
[INFO] Learning Basics .................................... SKIPPED
[INFO] Learning Basics - Logging Configuration ............ SKIPPED
[INFO] Learning Basics - Configure Programmatic ........... SKIPPED
[INFO] Learning Basics - Configure XML .................... SKIPPED
[INFO] Learning Basics - Destroying instances ............. SKIPPED
[INFO] Learning Basics - Loading instances ................ SKIPPED
[INFO] Learning Basics - Multiple Hazelcast Instances ..... SKIPPED
[INFO] Learning Basics - Unique Names ..................... SKIPPED
[INFO] Learning Basics - Wildcard Configuration ........... SKIPPED
[INFO] Learning Basics - Configuration of Data Structures at Runtime SKIPPED
[INFO] Map/Reduce ......................................... SKIPPED
[INFO] Monitoring ......................................... SKIPPED
[INFO] Monitoring - Cluster/Member Safety Examples ........ SKIPPED
[INFO] Near Cache ......................................... SKIPPED
[INFO] Near Cache: Fraud Detection ........................ SKIPPED
[INFO] Near Cache: Fraud Detection Common ................. SKIPPED
[INFO] Near Cache: Fraud Detection Server ................. SKIPPED
[INFO] Nea -Cache: Fraud Detection Client abstract base ... SKIPPED
[INFO] Near Cache: Fraud Detection Client with near-cache . SKIPPED
[INFO] Near Cache: Fraud Detection Client no near-cache ... SKIPPED
[INFO] Network Configuration .............................. SKIPPED
[INFO] Network Configuration - AWS ........................ SKIPPED
[INFO] Network Configuration - Firewall ................... SKIPPED
[INFO] Network Configuration - Groups ..................... SKIPPED
[INFO] Network Configuration - Group1 ..................... SKIPPED
[INFO] Network Configuration - Group2 ..................... SKIPPED
[INFO] Network Configuration - jclouds .................... SKIPPED
[INFO] Network Configuration - jclouds partition group .... SKIPPED
[INFO] Network Configuration - Multicast .................. SKIPPED
[INFO] Network Configuration - Multicast Plugin ........... SKIPPED
[INFO] Network Configuration - Partition Group ............ SKIPPED
[INFO] Network Configuration - Port ....................... SKIPPED
[INFO] Network Configuration - SSL ........................ SKIPPED
[INFO] Network Configuration - Symmetric Encryption ....... SKIPPED
[INFO] Network Configuration - TcpIp ...................... SKIPPED
[INFO] org-website-samples ................................ SKIPPED
[INFO] osgi ............................................... SKIPPED
[INFO] Replicated-Map ..................................... SKIPPED
[INFO] ReplicatedMap - Basics ............................. SKIPPED
[INFO] ReplicatedMap - EntryListener ...................... SKIPPED
[INFO] ReplicatedMap - In Memory Format ................... SKIPPED
[INFO] Querying ........................................... SKIPPED
[INFO] Querying: Projection on Keys ....................... SKIPPED
[INFO] Serialization ...................................... SKIPPED
[INFO] Serialization: ByteArray Serializer ................ SKIPPED
[INFO] Serialization: DataSerializable .................... SKIPPED
[INFO] Serialization: Externalizable ...................... SKIPPED
[INFO] Serialization: Global Serializer ................... SKIPPED
[INFO] Serialization: Hazelcast Airlines .................. SKIPPED
[INFO] Serialization: Hazelcast Airlines : The Code ....... SKIPPED
[INFO] Serialization: Hazelcast Airlines : Grid Node ...... SKIPPED
[INFO] Serialization: HazelcastInstanceAware .............. SKIPPED
[INFO] Serialization: IdentifiedDataSerializable .......... SKIPPED
[INFO] Serialization: Kryo Serializer ..................... SKIPPED
[INFO] Serialization: ManagedContext ...................... SKIPPED
[INFO] Serialization: Portable ............................ SKIPPED
[INFO] Serialization: Protobuf Serializer ................. SKIPPED
[INFO] Serialization: Serializable ........................ SKIPPED
[INFO] Serialization: Stream Serializer ................... SKIPPED
[INFO] Serialization: UserContext ......................... SKIPPED
[INFO] SPI ................................................ SKIPPED
[INFO] SPI: Backups ....................................... SKIPPED
[INFO] SPI: CounterService.Container ...................... SKIPPED
[INFO] Discovery SPI ...................................... SKIPPED
[INFO] SPI: Getting started ............................... SKIPPED
[INFO] SPI: Notification .................................. SKIPPED
[INFO] SPI: Partition Migration ........................... SKIPPED
[INFO] SPI: Priority Queue ................................ SKIPPED
[INFO] Priority Queue Core ................................ SKIPPED
[INFO] Priority Queue Server .............................. SKIPPED
[INFO] SPI: Proxy ......................................... SKIPPED
[INFO] SPI: Split-brain healing ........................... SKIPPED
[INFO] Transactions ....................................... SKIPPED
[INFO] Transactions - Transaction Basics .................. SKIPPED
[INFO] Transactions - Transactional Task .................. SKIPPED
[INFO] Transactions - XA Transaction ...................... SKIPPED
[INFO] Variable replacers ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:26 min
[INFO] Finished at: 2018-08-14T08:09:14+00:00
[INFO] Final Memory: 114M/381M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project ocp-demo-frontend: Fatal error compiling: java.lang.NoClassDefFoundError: com/sun/tools/javac/file/BaseFileObject: com.sun.tools.javac.file.BaseFileObject -> [Help 1]

Lombok library has probably problems on JDK9. IMO, Lombok should not be present in the code samples in a first place. Code samples should be as simple as possible. Lombok is quite a magic that not all developers (including me) are familiar with. I would strongly vote for removing it.

jcache example with multiple clients doesn't work

When running ClientDataProducer and ClientDataConsumer application throws exception

Exception in thread "main" javax.cache.CacheException: Error opening URI [file:/Users/vikgamov/projects/hazelcast-code-samples/jcache/src/main/resources/hazelcast-client-c1.xml]
    at com.hazelcast.cache.impl.AbstractHazelcastCachingProvider.getCacheManager(AbstractHazelcastCachingProvider.java:97)
    at com.hazelcast.cache.impl.AbstractHazelcastCachingProvider.getCacheManager(AbstractHazelcastCachingProvider.java:121)
    at com.hazelcast.cache.HazelcastCachingProvider.getCacheManager(HazelcastCachingProvider.java:151)
    at com.hazelcast.examples.AbstractApp.initCacheManager(AbstractApp.java:57)
    at com.hazelcast.examples.jcache.client.ClientDataProducer.runApp(ClientDataProducer.java:34)
    at com.hazelcast.examples.jcache.client.ClientDataProducer.main(ClientDataProducer.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.IllegalArgumentException: Not available Hazelcast instance. Please specify your Hazelcast configuration file path via "HazelcastCachingProvider.HAZELCAST_CONFIG_LOCATION" property or specify Hazelcast instance name via "HazelcastCachingProvider.HAZELCAST_INSTANCE_NAME" property in "properties" parameter.
    at com.hazelcast.client.cache.impl.HazelcastClientCachingProvider.createHazelcastCacheManager(HazelcastClientCachingProvider.java:62)
    at com.hazelcast.client.cache.impl.HazelcastClientCachingProvider.createHazelcastCacheManager(HazelcastClientCachingProvider.java:38)
    at com.hazelcast.cache.impl.AbstractHazelcastCachingProvider.getCacheManager(AbstractHazelcastCachingProvider.java:94)
    ... 10 more

Add more WAN samples

There are two WAN samples currently:

  • A basic sample that presents the minimal configuration needed to setup EE WAN replication with XML, YAML and programmatic configuration.
  • An interactive sample for map and cache replication.

We need to add some more:

  • A sample for implementing OS WAN replication.
  • IMap EE WAN sync sample for the two sync methods.
  • A complex EE WAN sample for a more advanced setup such as chain or WAN topology, B/G deployment scenario.
  • With advanced networking - how to setup WAN with SSL enabled (active/passive cluster might have different network configuration)

Add instructions how to build the samples

Provide more details how to build the code-samples in README.md or readme.html.

It's not obvious how to start with the code samples provided with Hazelcast. It's mainly important for people who didn't met Maven before.

The provided shell scripts don't build the sample themselves, they just expect the bits are ready in target directory.

Interdependencies
There is one more point related: it's not obvious if the samples are standalone or have some interdependecies. So if a user tries just one sample, it can experience dependency problems when another module (dependency) in not already in the local Maven repo.

Mention the possible cross-module dependenices in the readme too.

Learning-basics broken

Hi,

It seems that the Learning-basics module has not been updated to hazelcast-4.0 snapshot.

The learning-basics module configuration files still rely on the 3.11 configuration schema

<hazelcast xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.hazelcast.com/schema/config
                               http://www.hazelcast.com/schema/config/hazelcast-config-3.11.xsd"
           xmlns="http://www.hazelcast.com/schema/config">
[...]
</hazelcast>

Running the learning examples as-is leads to an XML exception (considering that the schemas don't match).
Upgrading the versions in the XML files does not work as there seems to be some breaking changes in the configuration schema.

  • Downgrading the learning basics module to version 3.11 in the POM leads to another exception being thrown.
Caused by: java.lang.IllegalStateException: Unable to get `original` field in `HazelcastInstanceProxy`!
	at com.hazelcast.examples.helper.CommonUtils.<clinit>(CommonUtils.java:49)
	... 1 more
Caused by: java.lang.NoClassDefFoundError: com/hazelcast/instance/impl/HazelcastInstanceProxy
	at com.hazelcast.examples.helper.CommonUtils.<clinit>(CommonUtils.java:46)
	... 1 more
Caused by: java.lang.ClassNotFoundException: com.hazelcast.instance.impl.HazelcastInstanceProxy
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 2 more

In the meantime I guess I'll check out a previous commit that still uses version 3.XX to get familiar with Hazelcast.

distributed-map locking examples fail

The Non Racy examples fail.

re-create:- run PessimisticUpdateMember twice at the same time, neither result is the expected 2000.

I have found the problem and will submit a pull request to the Maintenance branch.

Documentation: Kubernetes external client failure on Minikube

Following the instructions https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/kubernetes/samples/external-client

fails with

error: unable to recognize "service-per-pod.yaml": no matches for kind "Deployment" in version "apps/v1beta1"

because of apiVersion: apps/v1beta1 in service-per-pod.yaml

If I change this to apiVersion: apps/v1, pods are created but no load balancer

% kubectl get all
NAME              READY   STATUS    RESTARTS   AGE
pod/hazelcast-0   1/1     Running   0          6s
pod/hazelcast-1   1/1     Running   0          4s
pod/hazelcast-2   1/1     Running   0          3s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   2m43s

NAME                         READY   AGE
statefulset.apps/hazelcast   3/3     6s

minikube version: v1.10.1
macOS 10.15.4
kubectl:
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T23:35:15Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:48:36Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

How To use group in version 4.0.1

 EurekaOneDiscoveryStrategyFactory.setEurekaClient(eurekaClient);
    Config config = new Config();
    config.getGroupConfig().setName("business");
    config.setInstanceName("business-instance");

getGroupConfig was canceled in 4.0.1 ,how to work it

Docker swarm example

Can we please add a multi-host docker swarm deployment example? If there already is one, please point me to it.

Clearing code samples from internal API's and asserts.

I don't know if it is discussed before. Our code samples use internal API, which caused compile problem in this release when changed. Fixed here https://github.com/hazelcast/hazelcast-code-samples/pull/303/files
The reason of usage seems to demonstrate some features are working. And it resembles our unit tests.
I think the code sample does not need that much verification. Since it is to show how hazelcast should be used, it is giving wrong advice.

Heaviest usage is around simulating the split brain. That requires access to node. I think this should not be part of the code samples. Configuring split brain on code samples make sense. But simulating the behavior I think is part of the unit tests.
https://github.com/hazelcast/hazelcast-code-samples/blob/master/jcache/src/main/java/com/hazelcast/examples/splitbrain/AbstractCacheSplitBrainSample.java#L105

I see generateKeyOwnedBy usage. I don't think we are advising this to our users. Make sense for tests but users should use affinity features instead of generating the key for a specific partition. And interestingly, this also accesses to node.

I think we also need rules for using assertions. We have the following methods on Common Utils. My gut feeling says that code samples should not do assert.
.assertClusterSizeEventually;
.assertEquals;
.assertOpenEventually;

I am keen to do the following
System.out.println(cache1.get("key1"));//prints 'value'
instead of
assertEquals("value",);

Lastly, I see abstract class usages too much. Especially around SplitBrainSamples. I think code samples should be one class and simple. Using abstractions to demonstrate simple usages will scare of the users. This again seems to be caused by simulating the split brain. When we remove that part, abstractions will go away too.

Client near cache example doesn't compile

Failed on nightly build: https://hazelcast-l337.ci.cloudbees.com/view/Official%20Builds/job/Hazelcast-3.x-code-samples/5528/

Stacktrace:

[ERROR] COMPILATION ERROR : 
19:44:29 [INFO] -------------------------------------------------------------
19:44:29 [ERROR] /scratch/jenkins/workspace/Hazelcast-3.x-code-samples/clients/client-near-cache/src/main/java/com/hazelcast/examples/ClientNearCacheWithSerializedKeys.java:[4,33] cannot find symbol
19:44:29   symbol:   class HazelcastClientProxy
19:44:29   location: package com.hazelcast.client.impl
19:44:29 [ERROR] /scratch/jenkins/workspace/Hazelcast-3.x-code-samples/clients/client-near-cache/src/main/java/com/hazelcast/examples/ClientNearCacheWithSerializedKeys.java:[16,33] cannot find symbol
19:44:29   symbol:   class HazelcastClientProxy
19:44:29   location: class com.hazelcast.examples.ClientNearCacheWithSerializedKeys

There is no way to provide other port than 5701 in the kubernetes example

If I use an example from https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/kubernetes as is it works fine.
But if I change the port to some other for example 5800 then nodes start but they are not in cluster.

here it is my hazelcast.yaml:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: hazelcast
  labels:
    app: hazelcast
spec:
  replicas: 3
  serviceName: hazelcast-service
  selector:
    matchLabels:
      app: hazelcast
  template:
    metadata:
      labels:
        app: hazelcast
    spec:
      containers:
      - name: hazelcast
        image: hazelcast/hazelcast:3.10.3
        ports:
        - name: hazelcast
          containerPort: 5800
        livenessProbe:
          httpGet:
            path: /hazelcast/health/node-state
            port: 5800
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 5
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /hazelcast/health/node-state
            port: 5800
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 1
        volumeMounts:
        - name: hazelcast-storage
          mountPath: /data/hazelcast
        env:
        - name: JAVA_OPTS
          value: "-Dhazelcast.rest.enabled=true -Dhazelcast.config=/data/hazelcast/hazelcast.xml"
      volumes:
      - name: hazelcast-storage
        configMap:
          name: hazelcast-configuration

---

apiVersion: v1
kind: Service
metadata:
  name: hazelcast-service
spec:
  type: LoadBalancer
  selector:
    app: hazelcast
  ports:
  - protocol: TCP
    port: 5800

and config.yaml:

apiVersion: v1
kind: ConfigMap
metadata:
  name: hazelcast-configuration
data:
  hazelcast.xml: |-
    <?xml version="1.0" encoding="UTF-8"?>
    <hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.10.xsd"
                   xmlns="http://www.hazelcast.com/schema/config"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <properties>
        <property name="hazelcast.discovery.enabled">true</property>
      </properties>

      <network>
        <port>5800</port>
        <join>
          <multicast enabled="false"/>
          <tcp-ip enabled="false" />
          <discovery-strategies>
            <discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy">
            </discovery-strategy>
          </discovery-strategies>
        </join>
      </network>
    </hazelcast>

Some errata notes for the PDF book

First of all - terrific job on the book, many thanks for that. Now to the point:

  • Chapter 5.6 kind of duplicate content around "maximum number of backups"
  • Chapter 5.10.3 typos in words: "opertunity" and "prevens"
  • Chapter 5.16 text is missing/cut-off after "...record it owns, e.g. by adding the"
  • Chapter 7.3 text is missing/cut-off after "...subscribers that they"
  • Chapter 9.1 camelCase in "Imap"
  • Chapter 9.5.1 typo in word: "outout"

Hazelcast docker image versions in integration code samples are not updated

$ git grep hazelcast/hazelcast: 
hazelcast-integration/kubernetes/hazelcast.yaml:        image: hazelcast/hazelcast:3.10.3
hazelcast-integration/openshift/hazelcast-cluster/hazelcast-openshift-origin/hazelcast.yaml:  value: hazelcast/hazelcast:3.11

$ git grep hazelcast/hazelcast-enterprise:
hazelcast-integration/kubernetes/hazelcast-enterprise.yaml:        image: hazelcast/hazelcast-enterprise:3.10.3
hazelcast-integration/openshift/hazelcast-cluster/hazelcast-enterprise-openshift-centos/hazelcast.yaml:  value: hazelcast/hazelcast-enterprise:3.11

Could we come up with some improvement to avoid hardcoded versions (e.g. document providing as a parameter), or use some automation to update the version during release? (CC @leszko)

com.hazelcast.nio.serialization.HazelcastSerializationException

Hi, I trying to compile all the examples, but I find a problem, that I can't to solve.

In the example Cluster, that you have in "\hazelcast-code-samples\monitoring\cluster", when i'm trying to run ForceLocalMemberToBeSafe.java , Console show me this error:

Exception in thread "main" com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable serializer for class ForceLocalMemberToBeSafe$MemberSafe
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:218)
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:203)
at com.hazelcast.spi.impl.NodeEngineImpl.toData(NodeEngineImpl.java:180)
at com.hazelcast.executor.impl.ExecutorServiceProxy.submitToMember(ExecutorServiceProxy.java:301)
at com.hazelcast.executor.impl.ExecutorServiceProxy.submit(ExecutorServiceProxy.java:113)
at ForceLocalMemberToBeSafe.main(ForceLocalMemberToBeSafe.java:50)
ene 15, 2015 6:02:28 PM com.hazelcast.util.HealthMonitor

I don't know why I get this error

I use hazelcast 3.4 to complete your examples.

PS: IN other examples you use methods that are deprecated like
config.addAddress(); or config.getSocketOptions();
you can find this methods in client.java that you have in "\hazelcast-code-samples\clients\client-ssl\src\main\java"

Remove dependencies on old versions

We have many samples that work either directly or transitively with old Hazelcast versions. It leads to runtime problems (CNFEs for instance).

The following check was done for Hazelcast tag v4.0.1

mvn dependency:tree -Dverbose -DoutputFile=/tmp/dependency.txt -DappendOutput=true

egrep ':hazelcast-all:jar|:hazelcast:jar|:hazelcast-enterprise:jar|:hazelcast-enterprise-all:jar' /tmp/dependency.txt |
  grep -v 4\.0\.1 |
  sed 's#^.*\(com.hazelcast.*:compile\).*#\1#' |
  sort -u

com.hazelcast:hazelcast-all:jar:3.10.2:compile
com.hazelcast:hazelcast-all:jar:3.11.2:compile
com.hazelcast:hazelcast-all:jar:3.12.2:compile
com.hazelcast:hazelcast-all:jar:3.9.1:compile
com.hazelcast:hazelcast-all:jar:3.9:compile
com.hazelcast:hazelcast-enterprise:jar:3.11:compile
com.hazelcast:hazelcast:jar:3.10.2:compile
com.hazelcast:hazelcast:jar:3.11.4:compile
com.hazelcast:hazelcast:jar:3.11:compile
com.hazelcast:hazelcast:jar:3.12.2:compile
com.hazelcast:hazelcast:jar:3.12:compile
com.hazelcast:hazelcast:jar:3.7.5:compile
com.hazelcast:hazelcast:jar:3.7.7:compile
com.hazelcast:hazelcast:jar:3.7.8:compile
com.hazelcast:hazelcast:jar:3.7:compile
com.hazelcast:hazelcast:jar:3.9.1:compile
com.hazelcast:hazelcast:jar:3.9.3:compile
com.hazelcast:hazelcast:jar:3.9:compile

If we are not able to provide a code-sample with correct Hazelcast dependency, we should drop the sample from the related release (/tag).

We provide code samples archive as a separate download for every IMDG release, so it's a shame when the sample doesn't work with the given Hazelcast version.

Build fails .... The following artifacts could not be resolved: com.hazelcast:hazelcast-enterprise-all:jar:3.8-SNAPSHOT

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.822 s
[INFO] Finished at: 2017-01-23T22:01:56-05:00
[INFO] Final Memory: 44M/308M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project enterprise: Could not resolve dependencies for project com.hazelcast.samples.enterprise:enterprise:pom:0.1-SNAPSHOT: The following artifacts could not be resolved: com.hazelcast:hazelcast-enterprise-all:jar:3.8-SNAPSHOT, com.hazelcast:hazelcast-enterprise:jar:3.8-SNAPSHOT, com.hazelcast:hazelcast-enterprise-client:jar:3.8-SNAPSHOT: Failure to find com.hazelcast:hazelcast-enterprise-all:jar:3.8-20170123.161002-1055 in https://repository-hazelcast-l337.forge.cloudbees.com/snapshot/ was cached in the local repository, resolution will not be reattempted until the update interval of Hazelcast Private Snapshot Repository has elapsed or updates are forced -> [H

Misleading message is logged during retries if the service not exists

When the configured service not exists, the logged messages can be misleading.

When service discovery is set up to use a service which not exists, the following message get logged during the retires:
Couldn't connect to the Kubernetes master, [%s] retrying in %s seconds...

Based on the error message, I assumed that the API server is unaccessiable from the pod.

After 10 retries I got the real error message:
Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/test/endpoints/test-service

Configuration:

config.getNetworkConfig().getJoin().getKubernetesConfig().setEnabled(true)
                    .setProperty("namespace", "test")
                    .setProperty("service-name", "test-service");

It's not a big deal at all, however it can lead to a few hour long debug session if your application is killed by the readiness check before the real error message get logged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.