Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 10:45
    Holmistr commented #364
  • Jan 30 10:30
    devOpsHazelcast commented #364
  • Jan 30 10:30
    devOpsHazelcast commented #430
  • Jan 29 09:38
    mdumandag closed #459
  • Jan 29 09:38

    mdumandag on master

    add missing line to the cluster… (compare)

  • Jan 29 09:25
    mdumandag labeled #459
  • Jan 29 09:25
    mdumandag opened #459
  • Jan 29 08:37

    mdumandag on master

    remove member tool section from… (compare)

  • Jan 29 08:37
    mdumandag closed #458
  • Jan 29 08:12
    mdumandag opened #458
  • Jan 29 08:12
    mdumandag labeled #458
  • Jan 28 09:02

    asimarslan on member-tool

    (compare)

  • Jan 28 09:01

    asimarslan on maven_repo_update

    (compare)

  • Jan 28 03:28
  • Jan 23 08:53

    Holmistr on master

    Maven repository update (compare)

  • Jan 23 08:53
    Holmistr closed #457
  • Jan 22 15:17
    Holmistr opened #457
  • Jan 22 15:17

    Holmistr on maven_repo_update

    Maven repository update (compare)

  • Jan 22 07:00

    mdumandag on master

    update hazelcast version to use… (compare)

  • Jan 22 07:00
    mdumandag closed #456
ConceptJS
@conceptjs
@gAmUssA Sure. Here you are:
```
HazelcastInstance instance = Hazelcast.newHazelcastInstance();
Sorry press enter by accident
HazelcastInstance instance = Hazelcast.newHazelcastInstance();
Config config = instance.getConfig();
ReliableTopicConfig rtConfig = config.getReliableTopicConfig("scheduleJobUpdate");
rtConfig.addMessageListenerConfig(new ListenerConfig(new ScheduleJobUpdateListener()));
ScheduleJobUpdateListener listener = new ScheduleJobUpdateListener();
instance.getReliableTopic("scheduleJobUpdate").addMessageListener(listener);
Viktor Gamov
@gAmUssA
@conceptjs you should config topic before you start instance
ConceptJS
@conceptjs
@gAmUssA Sorry I didn't quite get what you mean. If I don't create instance using "Hazelcast.newHazelcastInstance()", I will not have config object to config the topic. Are you referring to config topic listener in hazelcast configure XML file?
Viktor Gamov
@gAmUssA
Config config = new Config();
    ReliableTopicConfig rtConfig = config.getReliableTopicConfig("scheduleJobUpdate");
    rtConfig.addMessageListenerConfig(new ListenerConfig(new ScheduleJobUpdateListener()));
    ScheduleJobUpdateListener listener = new ScheduleJobUpdateListener();
    HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
    instance.getReliableTopic("scheduleJobUpdate").addMessageListener(listener);
something like this
ConceptJS
@conceptjs

@gAmUssA I am using a XML file to config the Hazelcast instance so I tried adding the topic listener in the configure xml like following:

<reliable-topic name="scheduleJobUpdate">
        <read-batch-size>10</read-batch-size>
        <topic-overload-policy>DISCARD_OLDEST</topic-overload-policy>
        <statistics-enabled>true</statistics-enabled>
        <message-listeners>
            <message-listener>com.lambdazen.imdg.ScheduleJobUpdateListener</message-listener>
        </message-listeners>
    </reliable-topic>

But still not be able to receive the message from NodeJS...

Ilona Guenkina
@IlonaGuenkina_twitter
Hi all. Can you please explain me how to configure replicated map on node js server?
Viktor Gamov
@gAmUssA
pbrickell
@pbrickell
Is there a way to set the clients log level though configuration?
Mustafa İman
@mustafaiman
@pbrickell for now, default logger only logs INFO and upper levels of logs. However, you can configure hazelcast-client to use an external logging library such as winstonjs. You can find a code sample in https://github.com/hazelcast/hazelcast-nodejs-client/blob/master/code_samples/logging.js
pbrickell
@pbrickell
@mustafaiman That's perfect. Thanks.
Hari Prasanth
@HariLogana_twitter
Hi Guys, I posted a question in hazelcast/hazelcast group, repasting here, As it is the ideal one

@HariLogana_twitter
Hi Guys, I am trying to use the Hazelcast using nodejs client
I have the Hazelcast cluster server running in the 172.30.56.60, 61, 62

(i.e)

[ Member {
address: Address { host: '172.30.56.60', port: 5701, type: 4 },
uuid: 'bd6428f0-e888-453f-872f-6fe8296d751d',
isLiteMember: false,
attributes: {} },
Member {
address: Address { host: '172.30.56.61', port: 5701, type: 4 },
uuid: 'e0cd795a-0ca5-41ab-907a-492b61690a18',
isLiteMember: false,
attributes: {} },
Member {
address: Address { host: '172.30.56.62', port: 5701, type: 4 },
uuid: '0a834ae8-e707-4b5b-945b-362bfea08cf5',
isLiteMember: false,

attributes: {} } ]

I try to implement the Hazelcast distributed locking using nodejs using the following code,

// Initialize the hazelcast client instance.

var HazelcastClient = require('hazelcast-client').Client;
var Config = require('hazelcast-client').Config;
var config = new Config.ClientConfig();
config.networkConfig.addresses = [{host: '172.30.56.60', port: '5701'},{host: '172.30.56.61', port: '5701'}, {host: '172.30.56.62', port: '5701'}];
var lock = {};
var sleep = require('sleep');
HazelcastClient
.newHazelcastClient(config)
.then(function (hazelcastClient) {
lock = hazelcastClient.getLock("lock1");
// do stuff with lock
lock.lock();
console.log('Am locked in node with lock1...will be locked for 20 seconds');
sleep.sleep(20);
console.log('Unlocked now...');
lock.unlock();
process.exit();
});

I started the script node by node, I expected to establish the lock node by node, but instead it locks all the nodes in the same time. So it is not working as a distributed lock, so all the script started and ending in the same time (NOTE : For testing I provided 20 seconds sleep)

Please let me know, How to establish the distributed lock using node js in Hazelcast.

Mustafa İman
@mustafaiman
hello @HariLogana_twitter, lock() method returns a promise. You should attach a .then() handler to it.
right now, you send a lock() request and do not listen for its result
your second client instance actually does not have the lock until after twenty seconds but you do not wait for the response(which will not arrive until the previous owner releases the lock) in you code
lock.lock().then(function() { 
    sleep.sleep(20):
    return lock().unlock();
}).then(function() {
    console.log('unlocked now');
});
Hari Prasanth
@HariLogana_twitter
@mustafaiman thank u so much, I am new to nodejs, I didn't realize the promise
Radu Atanasiu
@raduongithub

Hello, I am trying to read map entries using the nodejs hazelcast client. Reading the same entries from Java or REST clients it works, however, for the nodeJS client, the following error occurs:

Unhandled rejection TypeError: Cannot read property 'read' of undefined
at SerializationServiceV1.toObject (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/hazelcast-client/lib/serialization/SerializationService.js:75:27)
at MapProxy.BaseProxy.toObject (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/hazelcast-client/lib/proxy/BaseProxy.js:114:54)
at Function.MapGetCodec.decodeResponse (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/hazelcast-client/lib/codec/MapGetCodec.js:54:38)
at /home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/hazelcast-client/lib/proxy/BaseProxy.js:33:33
at tryCatcher (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/radu/Work/workspaces/rf/road-family-2/tests/integration/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as _immediateCallback] (timers.js:729:5)

Did anybody encounter this issue already? Or do you have any pointers? Thanks.
Mustafa İman
@mustafaiman
@raduongithub can you elaborate on your problem? What kind of entries are these?
Radu Atanasiu
@raduongithub
The problem is like this: I am creating in Hazelcast from within Java application a Map holding some entries (I tried also with very simple data structures, like in the examples, containing just name and age). Then I'm trying to read those entries from a NodeJS application and I get the above errors.
Mustafa İman
@mustafaiman
Hello @raduongithub , hazelcast client protocol natively supports primitive types such as int, long, String etc. However if you use custom objects across multiple client languages you need to provide Hazelcast a serialization method. These are either IdentifiedDataSerializable or Portable. You can find more information about serialization here: http://docs.hazelcast.org/docs/latest-development/manual/html/Serialization/Overview.html . I short, you need to make your Java objects implement either IdentifiedDataSerializable or Portable. Also you need to do the same thing in Node.js client. Here is a sample in Node.js client: https://github.com/hazelcast/hazelcast-nodejs-client/blob/master/code_samples/org-website/IdentifiedDataSerializableSample.js
Mustafa İman
@mustafaiman
-sameroom portal
this is a test message for slack integration
Radu Atanasiu
@raduongithub
Wow, I got it. But this is really unconvenient, to basically have a model for every language... This means that, in a microservices architecture, if one wishes to use Hazelcast conveniently, then either stick to one language for all the services, either maintain for every service a model. I was expecting to be honest that Hazelcast is able to de-serialize objects at server level and just transmit data (either binary, either raw) to every client that would display it as it pleases. In case of Javascript I think it's not that difficult in the end to transform all the objects in JSON format, as mainly most of the JAVA-objects can be displayed as JSON eventually...
Alex R Maldonado
@OOCoder_twitter
jet api for NodeJS?
Mustafa İman
@mustafaiman
Hello @OOCoder_twitter , there is not a plan for a jet-nodejs integration in the near future. Please take a look at this thread hazelcast/hazelcast-nodejs-client#266 . Maybe you could find a workaround depending on what you want to do.
Alex R Maldonado
@OOCoder_twitter
thanks.
How about distributed queries?
Mustafa İman
@mustafaiman
Node.js client already has query support on Hazelcast cluster if it is good for your use case. Here is an example: https://github.com/hazelcast/hazelcast-nodejs-client/blob/master/code_samples/org-website/QuerySample.js .
Note that above example requires portable serialization implemented on the server side too. Refer to http://docs.hazelcast.org/docs/latest-development/manual/html/Serialization/Implementing_Portable_Serialization/index.html about portable serailization.
Alex R Maldonado
@OOCoder_twitter
thanks. I'll check it out.
luki-
@luki-
Hi there! I'd like to ask you for an advice on using hazelcast-nodejs-client -> currently, when an application lose connection to hz it does not automatically reconnect, is there a good builtin way to enable auto retry to recover from connection lost?
Chris Running Beard
@RunAllRun_twitter
Hi guys! Looking for any help on the issue I described here
Quite not sure if this is a bug or API not used properly
appreciate any help!
Mustafa İman
@mustafaiman
hi @RunAllRun_twitter , I answered your question on stackoverflow
Alex R Maldonado
@OOCoder_twitter
Hi, I started playing around with the Portable and SQL predicate interfaces very cool. I noticed that I can't serialize non-portable objects within a Portable object. Is there a workaround or a newer hazelcast version that allows me to use predicates on a document instead of mapping all fields? I'm currently testing using HZ v3.11. Thanks.
Guylherme Tabosa
@guylhermetabosa
Hi guys, the version 0.10 works with version 3.5.1 running on server?
I'm trying to connect but i'm getting connection refused and the server is running, I've pinged and used telnet, both works fine.
Mustafa İman
@mustafaiman
@guylhermetabosa Node.js client is compatible with Hazelcast 3.6 and up
Guylherme Tabosa
@guylhermetabosa
@mustafaiman Thanks! Is there any version of node-client that works with Hazelcast 3.5?
Mustafa İman
@mustafaiman
@guylhermetabosa no unfortunately
Guylherme Tabosa
@guylhermetabosa
Ok, thank you.
José Brandão
@josebrandao13_twitter
Hi guys, I arrived here from this issue: hazelcast/hazelcast-nodejs-client#252
Following the thinking line on the issue, what happens if a message is not successfully delivered to a consumer when using an Hazelcast Realiable Topic ?
What is the retry policy from the publisher side?