[zeromq-dev] [ANN] zmq-jni - Simple High Performance JNI Wrapper for ØMQ

2013-10-07 Thread Trevor Bernard
Hi, The goal of this project is to simplify and make easy the development of ØMQ bindings on the JVM. I attempt to do this by providing a very simple static interface (mirrors api.zeromq.org) and packaging up the shared library in the JAR itself. I currently only include Linux-amd64 in my builds

Re: [zeromq-dev] zmq_recvmsg jni

2013-10-03 Thread Trevor Bernard
Still curious. Does it mean that using DirectByteBuffer only makes sense if one uses ZMQ+Disruptor? Not at all. That's just one example of how I do it. -- what we win here There is no way (that I know of) to pass a Java byte array to the underlying c/c++ function without a copy. What the

Re: [zeromq-dev] zmq_recvmsg jni

2013-10-02 Thread Trevor Bernard
I do that very thing with a different method signature. https://github.com/trevorbernard/zmq-jni/blob/master/src/main/c%2B%2B/zmq.cpp#L169 I've had some success with preallocating a bunch of DirectByteBuffers off heap. It definitely helps with performance and GC. If I use byte[], it generates

Re: [zeromq-dev] zmq_recvmsg jni

2013-10-02 Thread Trevor Bernard
? pls. 2013/10/2 Trevor Bernard trevor.bern...@gmail.com: I do that very thing with a different method signature. https://github.com/trevorbernard/zmq-jni/blob/master/src/main/c%2B%2B/zmq.cpp#L169 I've had some success with preallocating a bunch of DirectByteBuffers off heap. It definitely

[zeromq-dev] zmq_recvmsg jni

2013-09-28 Thread Trevor Bernard
Hi guys, I messing around with JNI and libzmq and I was wondering if there was a way to avoid the memcpy? JNIEXPORT jobject JNICALL Java_org_zeromq_jni_ZMQ_zmq_1recv__JI (JNIEnv *env, jclass c, jlong socket, jint flags) { zmq_msg_t msg; zmq_msg_init (msg); zmq_recvmsg ((void *)

Re: [zeromq-dev] Authentication support in jzmq

2013-09-20 Thread Trevor Bernard
With the release of the zeromq4.x, I'll start working on adding authentication support in JZMQ shortly. On Wed, Sep 18, 2013 at 5:43 PM, Pieter Hintjens p...@imatix.com wrote: Authentication is on libzmq master, soon to become 4.x. 3.x does not have authentication. On Wed, Sep 18, 2013 at

Re: [zeromq-dev] jzmq recvZeroCopy not returning anything to me and cause error while exit

2013-09-17 Thread Trevor Bernard
Thanks for the test case. I will look at it in more detail later this evening. Might I suggest allocating the direct bytebuffer outside the loop and trying something like this.. ... while(true) { try { socket.recvZeroCopy(buffer, buffer.remaining(), ZMQ.DONTWAIT) ; }

Re: [zeromq-dev] Announce: cl-czmq - Common Lisp binding of CZMQ

2013-08-18 Thread Trevor Bernard
...@gmail.comwrote: This is awesome! Thank you for taking it off my plate. I have this on my most urgent...but not quite yet todo list. So I'll probably start pinging you with issues/pull requests in about 2 weeks (OK, that's optimistic). Between you and Trevor Bernard, my life just got at least 100x

Re: [zeromq-dev] Calling for features JZMQ-3.0

2013-08-13 Thread Trevor Bernard
, but as an integral part of it. ** ** I would be happy to participate in this renovated jzmq idea. Best regards, ** ** -- Gonzalo Diethelm DCV Chile ** ** *From:* zeromq-dev-boun...@lists.zeromq.org [mailto: zeromq-dev-boun...@lists.zeromq.org] *On Behalf Of *Trevor

[zeromq-dev] [ANN] cljzmq-0.1.1 - A Clojure binding for ØMQ

2013-07-29 Thread Trevor Bernard
Hello, I'd like to announce the immediate availability of cljzmq-0.1.1 on maven central. https://github.com/zeromq/cljzmq For sample usage, I've started porting the zguide examples here: https://github.com/trevorbernard/cljzmq-examples Pull requests welcome! Warmest regards, Trev

Re: [zeromq-dev] tcp vs zeromq

2013-07-12 Thread Trevor Bernard
In your performance experiment ZeroMQ will always be slower than TCP. There is a small overhead to using ZeroMQ but it's mitigated by other smart things it does like smart batching to avoid redundant network stack traversals. But if all you're doing is a synchronous PING/PONG, you lose that speed

[zeromq-dev] Calling for features JZMQ-3.0

2013-07-09 Thread Trevor Bernard
Hi all, I'm starting to work on JZMQ-3.0 and would like poll for opinions on features/bug fixes they would like to see included in the new JZMQ-3.0. There is currently no release date. The primary reason for the major release is to simplify the build process and make it easier for people to get

Re: [zeromq-dev] Functionality of connect/disconnect bind/unbind

2013-05-23 Thread Trevor Bernard
it is able to send the msgs. 2013/5/23 Trevor Bernard trevor.bern...@gmail.com I'm using libzmq 3.2.3 On Wed, May 22, 2013 at 12:05 PM, Trevor Bernard trevor.bern...@gmail.com wrote: What should the functionality be for the following scenario? ;; Conceptually, assume push and pull sockets

[zeromq-dev] Functionality of connect/disconnect bind/unbind

2013-05-22 Thread Trevor Bernard
What should the functionality be for the following scenario? ;; Conceptually, assume push and pull sockets are different processes (def ctx (zcontext 1)) (def ctx2 (zcontext 2)) (def push (- (socket ctx :push) (connect tcp://localhost:12345))) (send push (.getBytes msg1)) ;; true

Re: [zeromq-dev] Functionality of connect/disconnect bind/unbind

2013-05-22 Thread Trevor Bernard
I'm using libzmq 3.2.3 On Wed, May 22, 2013 at 12:05 PM, Trevor Bernard trevor.bern...@gmail.comwrote: What should the functionality be for the following scenario? ;; Conceptually, assume push and pull sockets are different processes (def ctx (zcontext 1)) (def ctx2 (zcontext 2)) (def

Re: [zeromq-dev] PUB/SUB appears to be 'missing' first byte 3.2.2

2013-05-20 Thread Trevor Bernard
What version of JZMQ are you using? I ran your test program and received the correct results. JZMQ - 018a38d414af4e689c93e29d4d7a59a1f51fe84e libzmq 3.2.2 On Mon, May 20, 2013 at 1:45 AM, Mark Sutheran mark_suthe...@yahoo.com wrote: Hi Pieter, Thanks for the quick response - test case below.

Re: [zeromq-dev] ByteBuffer API for JZMQ

2013-05-14 Thread Trevor Bernard
that references the byte[] passed back by zeromq. When you allocate direct, you’re unnecessarily copying this byte[] again. ** ** Parag ** ** *From:* zeromq-dev-boun...@lists.zeromq.org [mailto: zeromq-dev-boun...@lists.zeromq.org] *On Behalf Of *Trevor Bernard *Sent:* Monday, May

Re: [zeromq-dev] ByteBuffer API for JZMQ

2013-05-14 Thread Trevor Bernard
What is the purpose of int recvByteBuffer(int flags) ? Oops, typo. The return type should be ByteBuffer. You can create a direct bytebuffer with NewDirectByteBuffer. Will this be a true 0 copy implementation? Or will the buffer still be copied within the send/receive call? The buffer will

Re: [zeromq-dev] ByteBuffer API for JZMQ

2013-05-14 Thread Trevor Bernard
, May 14, 2013 at 8:35 AM, Trevor Bernard trevor.bern...@gmail.com wrote: What is the purpose of int recvByteBuffer(int flags) ? Oops, typo. The return type should be ByteBuffer. You can create a direct bytebuffer with NewDirectByteBuffer. Will this be a true 0 copy implementation

Re: [zeromq-dev] striking difference in performance among ZeroMQ bindings.

2013-05-03 Thread Trevor Bernard
Can someone provide their source? The JZMQ numbers seem off. Unless there was a performance regression introduced since then. Also what version of libzmq too. -Trev On Fri, May 3, 2013 at 5:28 AM, MinRK benjami...@gmail.com wrote: I ran your tests on my Linux machine (amd64 Ubuntu 12.04, 12

Re: [zeromq-dev] libzmq v3.2.3 released (stable)

2013-05-02 Thread Trevor Bernard
zmq_disconnect does not sent unsubscribe messages Contributors: Adrian Muraru, Ian Barber, KIU Shueng Chuan, Martin Hurton, Mika Fische, Dongmin Yu, MinRK, Pieter Hintjens, Stefan Radomski, Steven McCoy, Trevor Bernard, Victor Perron. Enjoy! -Pieter

Re: [zeromq-dev] Release date for zeromq-3.2.3

2013-05-01 Thread Trevor Bernard
I've back ported the fix here and submitted a pull request: https://github.com/trevorbernard/zeromq3-x Can you see if it works Victor? -Trev On Wed, May 1, 2013 at 10:17 AM, Steven McCoy steven.mc...@miru.hk wrote: On 1 May 2013 08:46, Victor Perron vic...@iso3103.net wrote: call fails

Re: [zeromq-dev] send() cause core dump or system pending

2013-04-12 Thread Trevor Bernard
Does the shared library libjzmq.so match the version of jzmq.jar? On Fri, Apr 12, 2013 at 10:46 AM, dennis dennis.d...@gmail.com wrote: I deploy my program on two machine. first machine run zeromq 2.2(open jdk 1.7) second machine run zeromq 3.2 (open jdk 1.7) the program is working fine

Re: [zeromq-dev] Compiling Java Bindings in AIX

2013-03-14 Thread Trevor Bernard
Did you try manually removing one of the $ in the the makefile? On Thu, Mar 14, 2013 at 4:11 PM, Gonzalo Vasquez gvasq...@altiuz.cl wrote: Environment: AIX 6.1 Power 7 Tried, both with a normal user and with root access, and with jzqm v2.1.2 and the also the latest from the master branch in

Re: [zeromq-dev] Frequent error messages

2013-03-12 Thread Trevor Bernard
That worked liked a charm! Awesome! How being too clean would harm the context creation/termination process? It seems there is something awry but someone more experienced with libzmq would have to chime in. In this new scenario the context will never be terminated as it'll linger idle in

Re: [zeromq-dev] Frequent error messages

2013-03-11 Thread Trevor Bernard
So aside, from a version number increase, and few changed comments, there doesn't seem be any real software upgrade, i.e. no src files modified, am I wrong? There should have been a few files changed:. This is the diff from the v2.1.2 tag with master:

Re: [zeromq-dev] Frequent error messages

2013-03-11 Thread Trevor Bernard
at 10:59 PM, Trevor Bernard trevor.bern...@gmail.com wrote: So aside, from a version number increase, and few changed comments, there doesn't seem be any real software upgrade, i.e. no src files modified, am I wrong? There should have been a few files changed:. This is the diff from

Re: [zeromq-dev] Frequent error messages

2013-03-08 Thread Trevor Bernard
Hi Gonzalo, Can you try building the latest from jzmq master? Not knowing what 2.1.2-SNAPSHOT you have, I can't be certain which fixes are included in your version. These issues might be contributing to your stability problems that have since been resolved: -

Re: [zeromq-dev] DEALER to ROUTER and reusing identity.

2013-02-25 Thread Trevor Bernard
I'd advise against trying to use identities to make this failover work. Okay. You're going to be fighting 0MQ's autoreconnect. Instead, provide authentication in the protocol itself and design the router app to do the failover itself. I don't understand what you mean when you say design

[zeromq-dev] DEALER to ROUTER and reusing identity.

2013-02-24 Thread Trevor Bernard
Hi, I have a use case where I'd like to re-cycle DEALER identities when a failover situation occurs. I have one service SV1 that creates a DEALER connection to a ROUTER socket on SVn. SV1 has a hot standby and uses the same identity in a failover situation. The first connect goes as you would

Re: [zeromq-dev] DEALER to ROUTER and reusing identity.

2013-02-24 Thread Trevor Bernard
Hi Min, Thanks for the suggestion. I added ROUTER_MANDATORY to my ROUTER but this didn't resolve my original problem however. The problem is after I reconnect on a different DEALER socket with the same identity, it no longer correctly routes the response. I'm curious if there is a way to reuse

[zeromq-dev] Removing the option to install jzmq.so... Thoughts?

2013-02-20 Thread Trevor Bernard
What are your thoughts on removing the option to install jzmq.so? Either include it as a native dependency or package the .dll, .so, .dylib in the same jar? Currently we have to worry about libzmq, jzmq, and the java library jiving in order to get a functional install. -Trev

[zeromq-dev] ANN: JZMQ 2.1.1

2013-02-17 Thread Trevor Bernard
I'd like to announce the immediate availability of JZMQ 2.1.1 on Maven Central * Add zero copy API to send and recv * Remove asserts from get_context JNI * Add ZLoop support * Poller rewrite * No longer c assert when trying to write to a closed Socket * Add a continuous integration support

Re: [zeromq-dev] Zero Copy in Java jzmq

2013-02-16 Thread Trevor Bernard
Also you'll need to use ByteBuffer.allocateDirect(...) in order for it to work. I explicitly didn't check GetDirectBufferAddress for perf reasons. For the JZMQ api, I used sendZeroCopy and recvZeroCopy for a lack of a better/fancier name. ;) -Trev On Sat, Feb 16, 2013 at 4:26 PM, Trevor Bernard

Re: [zeromq-dev] EAGAIN zmq_recv with no flags set

2013-02-16 Thread Trevor Bernard
Disregard my bug claims. I managed to figure this out. https://gist.github.com/trevorbernard/4969705 I had a misunderstood has zmq_recv worked. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Zero Copy in Java jzmq

2013-02-16 Thread Trevor Bernard
There is a zero copy API for JZMQ with this commit: https://github.com/zeromq/jzmq/commit/336a8a1d3269483ba67bb903c8dc0b1482079a33 Cheers On Sat, Feb 16, 2013 at 5:47 PM, Trevor Bernard trevor.bern...@gmail.com wrote: @gonzalo Did you do anything special on the client side to read the direct

Re: [zeromq-dev] Zero Copy in Java jzmq

2013-02-15 Thread Trevor Bernard
I'm thinking of extending jzmq to optionally allow the zero-copy technique using the concepts outlined by Martin Thompson here: That's awesome I'm not 100% sure I'll do it, I need some more experimentation first, but is there any interest or words of advice if someone's tried this already?

Re: [zeromq-dev] Zero Copy in Java jzmq

2013-02-15 Thread Trevor Bernard
: zeromq-dev-boun...@lists.zeromq.org [mailto:zeromq-dev- boun...@lists.zeromq.org] On Behalf Of Trevor Bernard Sent: Friday, February 15, 2013 2:02 PM To: thecarro...@jiminger.com; ZeroMQ development list Subject: Re: [zeromq-dev] Zero Copy in Java jzmq I'm thinking of extending jzmq

[zeromq-dev] ANN: JZMQ 2.1.0

2013-02-13 Thread Trevor Bernard
I'd like to announce the immediate availability of JZMQ 2.1.0 on Maven Central. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] JZMQ - Clean up build

2013-02-13 Thread Trevor Bernard
This has been merged into master and the branch no longer exists. On Tue, Feb 12, 2013 at 6:29 PM, Trevor Bernard trevor.bern...@gmail.com wrote: I have a branch that I would appreciate if a few JZMQ users would help me vet. I cleaned up the build process a bit to not modify files after

Re: [zeromq-dev] ZMQ JZMQ Logging

2013-02-13 Thread Trevor Bernard
I use ZMQ 2.X with the JZMQ binding. I am trying to debug a typical “java: Socket.cpp:561: void* get_socket(JNIEnv*, jobject, int): Assertion `s' failed.” I am probably sending a message on a closed socket, but it is difficult to correlate my application logs and the assert error. I would

[zeromq-dev] JZMQ - Clean up build

2013-02-12 Thread Trevor Bernard
I have a branch that I would appreciate if a few JZMQ users would help me vet. I cleaned up the build process a bit to not modify files after ./autogen.sh; ./configure; make If you could do a build from a clean state, it would be greatly appreciated.

Re: [zeromq-dev] Question for java users

2013-02-09 Thread Trevor Bernard
For the best optimised multithread application within a process, the concurrent package and disruptor would give better solution. But it would not scale well. What do you mean by would not scale well? ___ zeromq-dev mailing list

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-06 Thread Trevor Bernard
Any naming suggestions for the project? On Tue, Feb 5, 2013 at 9:05 PM, Trevor Bernard trevor.bern...@gmail.com wrote: If you guys define this new API, which I suppose will be implemented atop jzmq, we could also add it as a separate package to jzmq itself. Or maybe it should be a separate

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-06 Thread Trevor Bernard
I've been using distinct API names as well. I'll be releasing a rough version of what John and I discussed on my GitHub probably later this evening called, jzmq-api, with a basic wrapper around the existing jzmq. Keep on mind that's its very much a work in progress and it's to facilitate

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-06 Thread Trevor Bernard
to be; it's what I _sort of know_. Also I'd love to hear any suggestions or criticisms you may have. At some point I'll also include a Clojure idiomatic wrapper as well. -Trev On Wed, Feb 6, 2013 at 2:53 PM, Trevor Bernard trevor.bern...@gmail.com wrote: I've been using distinct API names as well. I'll

[zeromq-dev] JZMQ - Context.term hangs when PUSH/PULL happen on the same thread.

2013-02-06 Thread Trevor Bernard
Any one know why this hangs when you try to term the context. https://gist.github.com/trevorbernard/4727863 But if I run the sockets on a different thread, the context terms fine. https://gist.github.com/trevorbernard/4727870 I've seen a few mentions of this but I've yet to find a good

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-05 Thread Trevor Bernard
experiences will definitely be invaluable! :) On Sun, Feb 3, 2013 at 12:29 PM, John Watson jkwat...@gmail.com wrote: Sounds great, Trev. As soon as I have something roughed out, I'll send a pull request to the main jeromq project for perusal. On Sun, Feb 3, 2013 at 11:55 AM, Trevor

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-05 Thread Trevor Bernard
available on the irc channel? If so, let's coordinate off-list a time to chat about this. John On Tue, Feb 5, 2013 at 6:53 AM, Trevor Bernard trevor.bern...@gmail.com wrote: Awesome work John! I didn't realize you had a pull request in flight. We should have a chit chat at some point; I've also

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-05 Thread Trevor Bernard
My advice is to work in small cycles and using real code, e.g. the Guide samples, as your target. We use 0MQ internally for as our IPC mechanism. I'll likely first fulfil our needs and use-cases first before targeting the guide. CZMQ is of course for C; what is IMO a valuable aim is that we

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-05 Thread Trevor Bernard
If you guys define this new API, which I suppose will be implemented atop jzmq, we could also add it as a separate package to jzmq itself. Or maybe it should be a separate project on github. Anyway, I am open to anything we all agree on. I'm OK with either option. John has already made a

Re: [zeromq-dev] a more modern, Java-idiomatic jzmq/jeromq API

2013-02-03 Thread Trevor Bernard
I am in favour of this idea as well. Also, releasing stable builds to central would be a major plus. I'd be more than happy to donate my time for this effort. -Trev On Sun, Feb 3, 2013 at 1:02 PM, John Watson jkwat...@gmail.com wrote: On Sun, Feb 3, 2013 at 4:57 AM, Pieter Hintjens

[zeromq-dev] JZMQ Clarification: ZContext destroySocket setLinger

2013-01-21 Thread Trevor Bernard
On the following line: https://github.com/zeromq/jzmq/blob/master/src/org/zeromq/ZContext.java#L109 Should setLinger be set to 0 to immediately purge pending messages on the socket upon close? Or is the currently functionality correct? Also in the same method, shouldn't the close and remove be

<    1   2