# Example Client for ZeroMQ plugin

**URL:** <https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820>\
**Category:** Elasticsearch\
**Created:** [November 26, 2012, 7:24am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820 "2012-11-26T07:24:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 26, 2012, 7:24am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/1 "2012-11-26T07:24:22Z")

</div>

Have anyone worked with zeromq plugin for elasticserach?  
I tried to run SimpleClient provided by the github package, but couldn't  
post message on ElasticSearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [November 26, 2012, 8:23am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/2 "2012-11-26T08:23:07Z")

</div>

Hi Vinay,

Did you install zeromq and the plugin on every hosts? Which version of  
zeromq do you use? Which OS?

-- Tanguy

Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :

> Have anyone worked with zeromq plugin for elasticserach?  
> I tried to run SimpleClient provided by the github package, but couldn't  
> post message on Elasticsearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 26, 2012, 9:19am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/3 "2012-11-26T09:19:30Z")

</div>

I am using only one system. I installed 2.2 version of ZeroMQ and latest  
version of java binding. I am using Fedora 16.

On Monday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:

> Hi Vinay,
> 
> Did you install zeromq and the plugin on every hosts? Which version of  
> zeromq do you use? Which OS?
> 
> -- Tanguy
> 
> Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> 
> > Have anyone worked with zeromq plugin for elasticserach?  
> > I tried to run SimpleClient provided by the github package, but couldn't  
> > post message on Elasticsearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 26, 2012, 10:50am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/4 "2012-11-26T10:50:48Z")

</div>

I am using only one system. I installed 2.2 version of ZeroMQ and latest  
version of java binding. I am using Fedora 16.

On Monday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:

> Hi Vinay,
> 
> Did you install zeromq and the plugin on every hosts? Which version of  
> zeromq do you use? Which OS?
> 
> -- Tanguy
> 
> Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> 
> > Have anyone worked with zeromq plugin for elasticserach?  
> > I tried to run SimpleClient provided by the github package, but couldn't  
> > post message on Elasticsearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 27, 2012, 9:40am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/5 "2012-11-27T09:40:26Z")

</div>

Hi,

I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ and  
0.0.4 SNAPSHOT version of zeroMq transport plugin (  
[GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run the java  
SimpleClient in the test package in the github package. The client was able  
to send the message but couldn't receive the message from Elasticsearch.  
Java program stops at the line where socket.recv function called. I am  
thinking that it's waiting for the reply and could not receive the message.

Simple Client ::  
//Format function to append the message in the proper format  
private static byte format(String method, String url, String json,  
Integer count) throws UnsupportedEncodingException {  
StringBuilder sb = new StringBuilder(method);  
sb.append(ZMQSocket.SEPARATOR);  
if (count != null) {  
sb.append(url).append(count);  
} else {  
sb.append(url);  
}  
sb.append(ZMQSocket.SEPARATOR);

if (json != null) {  
sb.append(json);  
}  
return sb.toString().getBytes("UTF-8");  
}  
public static void main(String args) throws IOException {  
final ZMQ.Context context = ZMQ.context(1);  
ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
socket.connect(address);  
socket.send(format(method, url, json, null), 0);

byte response = socket.recv(0);//////////////////////////////////////At  
this line Java Program stops  
System.out.println(response);  
}

```
      finally {

```

try {  
socket.close();  
} catch (Exception e2) {  
// ignore  
}  
try {  
context.term();  
} catch (Exception e2) {  
// ignore  
}

System.out.printf("%d message(s) sent in %dms", repeat,  
System.currentTimeMillis()-startTime);  
}

Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:

> Hi Vinay,
> 
> Did you install zeromq and the plugin on every hosts? Which version of  
> zeromq do you use? Which OS?
> 
> -- Tanguy
> 
> Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> 
> > Have anyone worked with zeromq plugin for elasticserach?  
> > I tried to run SimpleClient provided by the github package, but couldn't  
> > post message on Elasticsearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [November 27, 2012, 11:28am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/6 "2012-11-27T11:28:00Z")

</div>

Hey,

Do you see log messages confirming that the zeromq plugin is listening for  
incoming message?

Do you check if a firewall is blocking port 9700?

Since this plugin is not part of elasticsearch core, you can move on  
[Issues · tlrx/transport-zeromq · GitHub](https://github.com/tlrx/transport-zeromq/issues) to report any bugs.

-- Tanguy

Le mardi 27 novembre 2012 10:40:26 UTC+1, Vinay Gurram a écrit :

> Hi,
> 
> I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ  
> and 0.0.4 SNAPSHOT version of zeroMq transport plugin (  
> [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run the  
> java SimpleClient in the test package in the github package. The client was  
> able to send the message but couldn't receive the message from  
> Elasticsearch. Java program stops at the line where socket.recv function  
> called. I am thinking that it's waiting for the reply and could not receive  
> the message.
> 
> Simple Client ::  
> //Format function to append the message in the proper format  
> private static byte format(String method, String url, String json,  
> Integer count) throws UnsupportedEncodingException {  
> StringBuilder sb = new StringBuilder(method);  
> sb.append(ZMQSocket.SEPARATOR);  
> if (count != null) {  
> sb.append(url).append(count);  
> } else {  
> sb.append(url);  
> }  
> sb.append(ZMQSocket.SEPARATOR);
> 
> if (json != null) {  
> sb.append(json);  
> }  
> return sb.toString().getBytes("UTF-8");  
> }  
> public static void main(String args) throws IOException {  
> final ZMQ.Context context = ZMQ.context(1);  
> ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
> socket.connect(address);  
> socket.send(format(method, url, json, null), 0);
> 
> byte response = socket.recv(0);//////////////////////////////////////At  
> this line Java Program stops  
> System.out.println(response);  
> }
> 
> ```
> finally {
> 
> ```
> 
> try {  
> socket.close();  
> } catch (Exception e2) {  
> // ignore  
> }  
> try {  
> context.term();  
> } catch (Exception e2) {  
> // ignore  
> }
> 
> System.out.printf("%d message(s) sent in %dms", repeat,  
> System.currentTimeMillis()-startTime);  
> }
> 
> Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
> 
> > Hi Vinay,
> > 
> > Did you install zeromq and the plugin on every hosts? Which version of  
> > zeromq do you use? Which OS?
> > 
> > -- Tanguy
> > 
> > Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> > 
> > > Have anyone worked with zeromq plugin for elasticserach?  
> > > I tried to run SimpleClient provided by the github package, but couldn't  
> > > post message on Elasticsearch. Can anyone provide a working example code?

--

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 27, 2012, 1:27pm UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/7 "2012-11-27T13:27:32Z")

</div>

Hey,

I am a complete newbie. Elastic Search only starts ZeroMQ context and  
server. My bad for not reading the whole github document of the  
([GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)), the new plugin is not  
supposed to receive any response.I am going through the source code of the  
0.0.4SNAPSHOT version. He vomited some of the functions in the new version.  
Your version of plugin works fine with the 0.19.2 version. But I am  
working on 0.19.11 version :-(. So I have to make changes to your code so  
that it might work with the new version of Elasticsearch. Thanks for the  
reply 🙂

On Tuesday, November 27, 2012 4:58:00 PM UTC+5:30, Tanguy wrote:

> Hey,
> 
> Do you see log messages confirming that the zeromq plugin is listening for  
> incoming message?
> 
> Do you check if a firewall is blocking port 9700?
> 
> Since this plugin is not part of elasticsearch core, you can move on  
> [Issues · tlrx/transport-zeromq · GitHub](https://github.com/tlrx/transport-zeromq/issues) to report any bugs.
> 
> -- Tanguy
> 
> Le mardi 27 novembre 2012 10:40:26 UTC+1, Vinay Gurram a écrit :
> 
> > Hi,
> > 
> > I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ  
> > and 0.0.4 SNAPSHOT version of zeroMq transport plugin (  
> > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run the  
> > java SimpleClient in the test package in the github package. The client was  
> > able to send the message but couldn't receive the message from  
> > Elasticsearch. Java program stops at the line where socket.recv function  
> > called. I am thinking that it's waiting for the reply and could not receive  
> > the message.
> > 
> > Simple Client ::  
> > //Format function to append the message in the proper format  
> > private static byte format(String method, String url, String json,  
> > Integer count) throws UnsupportedEncodingException {  
> > StringBuilder sb = new StringBuilder(method);  
> > sb.append(ZMQSocket.SEPARATOR);  
> > if (count != null) {  
> > sb.append(url).append(count);  
> > } else {  
> > sb.append(url);  
> > }  
> > sb.append(ZMQSocket.SEPARATOR);
> > 
> > if (json != null) {  
> > sb.append(json);  
> > }  
> > return sb.toString().getBytes("UTF-8");  
> > }  
> > public static void main(String args) throws IOException {  
> > final ZMQ.Context context = ZMQ.context(1);  
> > ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
> > socket.connect(address);  
> > socket.send(format(method, url, json, null), 0);
> > 
> > byte response = socket.recv(0);//////////////////////////////////////At  
> > this line Java Program stops  
> > System.out.println(response);  
> > }
> > 
> > ```
> > finally {
> > 
> > ```
> > 
> > try {  
> > socket.close();  
> > } catch (Exception e2) {  
> > // ignore  
> > }  
> > try {  
> > context.term();  
> > } catch (Exception e2) {  
> > // ignore  
> > }
> > 
> > System.out.printf("%d message(s) sent in %dms", repeat,  
> > System.currentTimeMillis()-startTime);  
> > }
> > 
> > Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
> > 
> > > Hi Vinay,
> > > 
> > > Did you install zeromq and the plugin on every hosts? Which version of  
> > > zeromq do you use? Which OS?
> > > 
> > > -- Tanguy
> > > 
> > > Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> > > 
> > > > Have anyone worked with zeromq plugin for elasticserach?  
> > > > I tried to run SimpleClient provided by the github package, but  
> > > > couldn't post message on Elasticsearch. Can anyone provide a working  
> > > > example code?

--

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [November 27, 2012, 1:34pm UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/8 "2012-11-27T13:34:17Z")

</div>

Glad you find the source of your problem.

Pull requests are greatly appreciated ;o)

-- Tanguy

Le mardi 27 novembre 2012 14:27:32 UTC+1, Vinay Gurram a écrit :

> Hey,
> 
> I am a complete newbie. Elastic Search only starts ZeroMQ context and  
> server. My bad for not reading the whole github document of the (  
> [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)), the new plugin is not  
> supposed to receive any response.I am going through the source code of the  
> 0.0.4SNAPSHOT version. He vomited some of the functions in the new version.  
> Your version of plugin works fine with the 0.19.2 version. But I am  
> working on 0.19.11 version :-(. So I have to make changes to your code so  
> that it might work with the new version of Elasticsearch. Thanks for the  
> reply 🙂
> 
> On Tuesday, November 27, 2012 4:58:00 PM UTC+5:30, Tanguy wrote:
> 
> > Hey,
> > 
> > Do you see log messages confirming that the zeromq plugin is listening  
> > for incoming message?
> > 
> > Do you check if a firewall is blocking port 9700?
> > 
> > Since this plugin is not part of elasticsearch core, you can move on  
> > [Issues · tlrx/transport-zeromq · GitHub](https://github.com/tlrx/transport-zeromq/issues) to report any bugs.
> > 
> > -- Tanguy
> > 
> > Le mardi 27 novembre 2012 10:40:26 UTC+1, Vinay Gurram a écrit :
> > 
> > > Hi,
> > > 
> > > I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ  
> > > and 0.0.4 SNAPSHOT version of zeroMq transport plugin (  
> > > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run the  
> > > java SimpleClient in the test package in the github package. The client was  
> > > able to send the message but couldn't receive the message from  
> > > Elasticsearch. Java program stops at the line where socket.recv function  
> > > called. I am thinking that it's waiting for the reply and could not receive  
> > > the message.
> > > 
> > > Simple Client ::  
> > > //Format function to append the message in the proper format  
> > > private static byte format(String method, String url, String json,  
> > > Integer count) throws UnsupportedEncodingException {  
> > > StringBuilder sb = new StringBuilder(method);  
> > > sb.append(ZMQSocket.SEPARATOR);  
> > > if (count != null) {  
> > > sb.append(url).append(count);  
> > > } else {  
> > > sb.append(url);  
> > > }  
> > > sb.append(ZMQSocket.SEPARATOR);
> > > 
> > > if (json != null) {  
> > > sb.append(json);  
> > > }  
> > > return sb.toString().getBytes("UTF-8");  
> > > }  
> > > public static void main(String args) throws IOException {  
> > > final ZMQ.Context context = ZMQ.context(1);  
> > > ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
> > > socket.connect(address);  
> > > socket.send(format(method, url, json, null), 0);
> > > 
> > > byte response =  
> > > socket.recv(0);//////////////////////////////////////At this line Java  
> > > Program stops  
> > > System.out.println(response);  
> > > }
> > > 
> > > ```
> > > finally {
> > > 
> > > ```
> > > 
> > > try {  
> > > socket.close();  
> > > } catch (Exception e2) {  
> > > // ignore  
> > > }  
> > > try {  
> > > context.term();  
> > > } catch (Exception e2) {  
> > > // ignore  
> > > }
> > > 
> > > System.out.printf("%d message(s) sent in %dms", repeat,  
> > > System.currentTimeMillis()-startTime);  
> > > }
> > > 
> > > Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
> > > 
> > > > Hi Vinay,
> > > > 
> > > > Did you install zeromq and the plugin on every hosts? Which version of  
> > > > zeromq do you use? Which OS?
> > > > 
> > > > -- Tanguy
> > > > 
> > > > Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> > > > 
> > > > > Have anyone worked with zeromq plugin for elasticserach?  
> > > > > I tried to run SimpleClient provided by the github package, but  
> > > > > couldn't post message on Elasticsearch. Can anyone provide a working  
> > > > > example code?

--

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://discuss.elastic.co/u/Vinay)\
**Post date:** [November 27, 2012, 1:40pm UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/9 "2012-11-27T13:40:57Z")

</div>

Hey

Are you going to update the ZeroMq plugin for Elastic Search. If you do  
that, that will be a great help for lots of us newbies.

On Tuesday, November 27, 2012 7:04:17 PM UTC+5:30, Tanguy wrote:

> Glad you find the source of your problem.
> 
> Pull requests are greatly appreciated ;o)
> 
> -- Tanguy
> 
> Le mardi 27 novembre 2012 14:27:32 UTC+1, Vinay Gurram a écrit :
> 
> > Hey,
> > 
> > I am a complete newbie. Elastic Search only starts ZeroMQ context and  
> > server. My bad for not reading the whole github document of the (  
> > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)), the new plugin is not  
> > supposed to receive any response.I am going through the source code of the  
> > 0.0.4SNAPSHOT version. He vomited some of the functions in the new version.  
> > Your version of plugin works fine with the 0.19.2 version. But I am  
> > working on 0.19.11 version :-(. So I have to make changes to your code so  
> > that it might work with the new version of Elasticsearch. Thanks for the  
> > reply 🙂
> > 
> > On Tuesday, November 27, 2012 4:58:00 PM UTC+5:30, Tanguy wrote:
> > 
> > > Hey,
> > > 
> > > Do you see log messages confirming that the zeromq plugin is listening  
> > > for incoming message?
> > > 
> > > Do you check if a firewall is blocking port 9700?
> > > 
> > > Since this plugin is not part of elasticsearch core, you can move on  
> > > [Issues · tlrx/transport-zeromq · GitHub](https://github.com/tlrx/transport-zeromq/issues) to report any bugs.
> > > 
> > > -- Tanguy
> > > 
> > > Le mardi 27 novembre 2012 10:40:26 UTC+1, Vinay Gurram a écrit :
> > > 
> > > > Hi,
> > > > 
> > > > I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ  
> > > > and 0.0.4 SNAPSHOT version of zeroMq transport plugin (  
> > > > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run the  
> > > > java SimpleClient in the test package in the github package. The client was  
> > > > able to send the message but couldn't receive the message from  
> > > > Elasticsearch. Java program stops at the line where socket.recv function  
> > > > called. I am thinking that it's waiting for the reply and could not receive  
> > > > the message.
> > > > 
> > > > Simple Client ::  
> > > > //Format function to append the message in the proper format  
> > > > private static byte format(String method, String url, String json,  
> > > > Integer count) throws UnsupportedEncodingException {  
> > > > StringBuilder sb = new StringBuilder(method);  
> > > > sb.append(ZMQSocket.SEPARATOR);  
> > > > if (count != null) {  
> > > > sb.append(url).append(count);  
> > > > } else {  
> > > > sb.append(url);  
> > > > }  
> > > > sb.append(ZMQSocket.SEPARATOR);
> > > > 
> > > > if (json != null) {  
> > > > sb.append(json);  
> > > > }  
> > > > return sb.toString().getBytes("UTF-8");  
> > > > }  
> > > > public static void main(String args) throws IOException {  
> > > > final ZMQ.Context context = ZMQ.context(1);  
> > > > ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
> > > > socket.connect(address);  
> > > > socket.send(format(method, url, json, null), 0);
> > > > 
> > > > byte response =  
> > > > socket.recv(0);//////////////////////////////////////At this line Java  
> > > > Program stops  
> > > > System.out.println(response);  
> > > > }
> > > > 
> > > > ```
> > > > finally {
> > > > 
> > > > ```
> > > > 
> > > > try {  
> > > > socket.close();  
> > > > } catch (Exception e2) {  
> > > > // ignore  
> > > > }  
> > > > try {  
> > > > context.term();  
> > > > } catch (Exception e2) {  
> > > > // ignore  
> > > > }
> > > > 
> > > > System.out.printf("%d message(s) sent in %dms", repeat,  
> > > > System.currentTimeMillis()-startTime);  
> > > > }
> > > > 
> > > > Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
> > > > 
> > > > > Hi Vinay,
> > > > > 
> > > > > Did you install zeromq and the plugin on every hosts? Which version of  
> > > > > zeromq do you use? Which OS?
> > > > > 
> > > > > -- Tanguy
> > > > > 
> > > > > Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> > > > > 
> > > > > > Have anyone worked with zeromq plugin for elasticserach?  
> > > > > > I tried to run SimpleClient provided by the github package, but  
> > > > > > couldn't post message on Elasticsearch. Can anyone provide a working  
> > > > > > example code?

--

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [November 28, 2012, 9:27am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/10 "2012-11-28T09:27:40Z")

</div>

Not planned yet. Maybe later if I have enough time 😕

-- Tanguy

Le mardi 27 novembre 2012 14:40:57 UTC+1, Vinay Gurram a écrit :

> Hey
> 
> Are you going to update the ZeroMq plugin for Elastic Search. If you do  
> that, that will be a great help for lots of us newbies.
> 
> On Tuesday, November 27, 2012 7:04:17 PM UTC+5:30, Tanguy wrote:
> 
> > Glad you find the source of your problem.
> > 
> > Pull requests are greatly appreciated ;o)
> > 
> > -- Tanguy
> > 
> > Le mardi 27 novembre 2012 14:27:32 UTC+1, Vinay Gurram a écrit :
> > 
> > > Hey,
> > > 
> > > I am a complete newbie. Elastic Search only starts ZeroMQ context and  
> > > server. My bad for not reading the whole github document of the (  
> > > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)), the new plugin is not  
> > > supposed to receive any response.I am going through the source code of the  
> > > 0.0.4SNAPSHOT version. He vomited some of the functions in the new version.  
> > > Your version of plugin works fine with the 0.19.2 version. But I am  
> > > working on 0.19.11 version :-(. So I have to make changes to your code so  
> > > that it might work with the new version of Elasticsearch. Thanks for the  
> > > reply 🙂
> > > 
> > > On Tuesday, November 27, 2012 4:58:00 PM UTC+5:30, Tanguy wrote:
> > > 
> > > > Hey,
> > > > 
> > > > Do you see log messages confirming that the zeromq plugin is listening  
> > > > for incoming message?
> > > > 
> > > > Do you check if a firewall is blocking port 9700?
> > > > 
> > > > Since this plugin is not part of elasticsearch core, you can move on  
> > > > [Issues · tlrx/transport-zeromq · GitHub](https://github.com/tlrx/transport-zeromq/issues) to report any bugs.
> > > > 
> > > > -- Tanguy
> > > > 
> > > > Le mardi 27 novembre 2012 10:40:26 UTC+1, Vinay Gurram a écrit :
> > > > 
> > > > > Hi,
> > > > > 
> > > > > I changed to 0.19.10 version of Elasticsearch, 2.2 version of  
> > > > > ZeroMQ and 0.0.4 SNAPSHOT version of zeroMq transport plugin (  
> > > > > [GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/bpaquet/transport-zeromq)). I am not able to run  
> > > > > the java SimpleClient in the test package in the github package. The client  
> > > > > was able to send the message but couldn't receive the message from  
> > > > > Elasticsearch. Java program stops at the line where socket.recv function  
> > > > > called. I am thinking that it's waiting for the reply and could not receive  
> > > > > the message.
> > > > > 
> > > > > Simple Client ::  
> > > > > //Format function to append the message in the proper format  
> > > > > private static byte format(String method, String url, String  
> > > > > json, Integer count) throws UnsupportedEncodingException {  
> > > > > StringBuilder sb = new StringBuilder(method);  
> > > > > sb.append(ZMQSocket.SEPARATOR);  
> > > > > if (count != null) {  
> > > > > sb.append(url).append(count);  
> > > > > } else {  
> > > > > sb.append(url);  
> > > > > }  
> > > > > sb.append(ZMQSocket.SEPARATOR);
> > > > > 
> > > > > if (json != null) {  
> > > > > sb.append(json);  
> > > > > }  
> > > > > return sb.toString().getBytes("UTF-8");  
> > > > > }  
> > > > > public static void main(String args) throws IOException {  
> > > > > final ZMQ.Context context = ZMQ.context(1);  
> > > > > ZMQ.Socket socket = context.socket(ZMQ.DEALER);  
> > > > > socket.connect(address);  
> > > > > socket.send(format(method, url, json, null), 0);
> > > > > 
> > > > > byte response =  
> > > > > socket.recv(0);//////////////////////////////////////At this line Java  
> > > > > Program stops  
> > > > > System.out.println(response);  
> > > > > }
> > > > > 
> > > > > ```
> > > > > finally {
> > > > > 
> > > > > ```
> > > > > 
> > > > > try {  
> > > > > socket.close();  
> > > > > } catch (Exception e2) {  
> > > > > // ignore  
> > > > > }  
> > > > > try {  
> > > > > context.term();  
> > > > > } catch (Exception e2) {  
> > > > > // ignore  
> > > > > }
> > > > > 
> > > > > System.out.printf("%d message(s) sent in %dms", repeat,  
> > > > > System.currentTimeMillis()-startTime);  
> > > > > }
> > > > > 
> > > > > Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
> > > > > 
> > > > > > Hi Vinay,
> > > > > > 
> > > > > > Did you install zeromq and the plugin on every hosts? Which version  
> > > > > > of zeromq do you use? Which OS?
> > > > > > 
> > > > > > -- Tanguy
> > > > > > 
> > > > > > Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
> > > > > > 
> > > > > > > Have anyone worked with zeromq plugin for elasticserach?  
> > > > > > > I tried to run SimpleClient provided by the github package, but  
> > > > > > > couldn't post message on Elasticsearch. Can anyone provide a working  
> > > > > > > example code?

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:02am UTC](https://discuss.elastic.co/t/example-client-for-zeromq-plugin/9820/11 "2017-07-06T03:02:31Z")

</div>


