Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't not create mutiple client in multiple thread #4

Open
phuongdo opened this issue Jan 31, 2018 · 2 comments
Open

Can't not create mutiple client in multiple thread #4

phuongdo opened this issue Jan 31, 2018 · 2 comments

Comments

@phuongdo
Copy link

phuongdo commented Jan 31, 2018

Hi,
I gona write a web server application that handle large number of requests to 2 NodeEndpoints ( Eg.
http://NODE1:7895 and http://NODE2:7895 ) . I found that there is only one option for node endpoint in Global variable which can not be applied in multiple-thread environment.

Globals.setNodeEndpoint(new NodeEndpoint("http","NODE1",7895));

What's should I do?
Thanks

@alvin-reyes
Copy link

Hi, I'm planning to put up a solution for that. The reason why it wasn't initially supported is because nem.core library only allows the current vm process to set the node once and its a global/static variable. I have a modified version of nem.core that will allow multiple client instance so the multiple threads can have an instance of an API client with a different node setup. This will be on the next release within next week.

Solution for now is to launch a new vm (means running a new instance of your java app) and then parametarized the node configuration so that each new vm process will have its own node connection.

@phuongdo
Copy link
Author

phuongdo commented Mar 5, 2018

Hi Alvin,
Thanks for you comment. I did modify nem.core for my own purpose and It works now.
However, I'm still waiting for the next official release version.
Kind regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants