Coder Social home page Coder Social logo

eta-hazelcast's Introduction

Hazelcast example in Eta

Note that this example is not using the Direct Java Interop feature and I've manually written the FFI imports for now. A better example is yet to come ;)

Hazelcast is a distributed data system that supports high scalability and data distribution in a clustered environment.

In this example we will create a cluster member, distributed Map to share Map data among the cluster nodes and create a client to connect and query data in the cluster.

Maven Dependencies

The maven dependencies for Hazelcast Cluster Member and Hazelcast Java Client are added in the eta-hazelcast.cabal file.

maven-depends:       com.hazelcast:hazelcast:3.10
...
maven-depends:       com.hazelcast:hazelcast:3.10, com.hazelcast:hazelcast-client:3.10

Running the server

  1. Fire up the terminal and enter the commands:
$ git clone https://github.com/Jyothsnasrinivas/eta-hazelcast.git
$ cd eta-hazelcast
$ etlas run hazelcast-server
  1. When we start the hazelcast-server application, we can see the flowing text in the console.
Members {size:1, ver:1} [
	Member [192.168.0.104]:5701 - 564aa798-70a8-48d8-8ef9-c0590adb853b this
]
  1. To create multiple nodes we can start the multiple instances of hazelcast-server. That means open up another terminal instance and run the command etlas run hazelcast-server simultaneously with the first instance. You will notice the following log in the console.
Members {size:2, ver:2} [
	Member [192.168.0.104]:5701 - 564aa798-70a8-48d8-8ef9-c0590adb853b this
	Member [192.168.0.104]:5702 - e2d32f12-b7af-4991-8c9d-3b8f85f197a9
]

Running the client

  1. Fire up another terminal instance and enter the command.
$ etlas run hazelcast-client
  1. You can try few more instances to see Hazelcast work.

Credits

This example is inspired from the Hazelcast tutorial by Eugen.

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.