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

Draft Methods #867

Open
richardwei6 opened this issue Dec 28, 2020 · 10 comments
Open

Draft Methods #867

richardwei6 opened this issue Dec 28, 2020 · 10 comments

Comments

@richardwei6
Copy link

Will Draft methods such as RADIO/DISH ever be implemented into JeroMQ? I originally wanted to use JZMQ but had problems installing it. If it won't be implemented, how would I start adding it to JeroMQ? Thanks.

@fredoboulo
Copy link
Contributor

hi,

RADIO/DISH sockets are already available in zmq package, in the latest SNAPSHOT. I just made a PR to include them in org.zeromq as well.

@richardwei6
Copy link
Author

Thanks for letting me know! Here's the pull request for reference: #868

@richardwei6
Copy link
Author

richardwei6 commented Jan 2, 2021

Ok, so I have a new issue with the draft implmentations. When using the udp protocol, I'm getting the Protocol not supported exception being thrown when trying to connect to this address: udp://224.0.0.1:28650. Is it possible that this is not implmented? If so, how would one go about implementing it? @fredoboulo

@fbacchella
Copy link
Contributor

I wonder if that try could help: https://github.com/fbacchella/jeromq/commits/networkprotocolserviceprovider
It allows to provide protocol as Services: https://www.baeldung.com/java-spi

@richardwei6
Copy link
Author

richardwei6 commented Jan 4, 2021

I wonder if that try could help: https://github.com/fbacchella/jeromq/commits/networkprotocolserviceprovider
It allows to provide protocol as Services: https://www.baeldung.com/java-spi

Ok, I've merged your branch with the main branch of this repo to create this repo: https://github.com/richardwei6/jeromq. This repo contains your "networkprotocolserviceprovider" branch.

On my android studio project, I'm using jitpack to use external Github libraries from here: https://stackoverflow.com/a/34963958.

However, when trying to compile the repository mentioned above, it's getting a build error found at the end of these logs: https://jitpack.io/com/github/richardwei6/jeromq/master-v0.5.2-g3a23566-182/build.log.

Specifically, here is the small section that describes it:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Peer.java:[14,27] cannot find symbol
  symbol:   variable ZMQ_PEER
  location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Peer.java:[22,16] cannot find symbol
  symbol:   variable peerLastRoutingId
  location: variable options of type zmq.Options
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Raw.java:[12,27] cannot find symbol
  symbol:   variable ZMQ_RAW
  location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/scattergather/Gather.java:[21,27] cannot find symbol
  symbol:   variable ZMQ_GATHER
  location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Channel.java:[21,27] cannot find symbol
  symbol:   variable ZMQ_CHANNEL
  location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/scattergather/Scatter.java:[21,27] cannot find symbol
  symbol:   variable ZMQ_SCATTER
  location: class zmq.ZMQ
[INFO] 6 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.864 s
[INFO] Finished at: 2021-01-03T23:46:21Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project jeromq: Compilation failure: Compilation failure: 
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Peer.java:[14,27] cannot find symbol
[ERROR]   symbol:   variable ZMQ_PEER
[ERROR]   location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Peer.java:[22,16] cannot find symbol
[ERROR]   symbol:   variable peerLastRoutingId
[ERROR]   location: variable options of type zmq.Options
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Raw.java:[12,27] cannot find symbol
[ERROR]   symbol:   variable ZMQ_RAW
[ERROR]   location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/scattergather/Gather.java:[21,27] cannot find symbol
[ERROR]   symbol:   variable ZMQ_GATHER
[ERROR]   location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/Channel.java:[21,27] cannot find symbol
[ERROR]   symbol:   variable ZMQ_CHANNEL
[ERROR]   location: class zmq.ZMQ
[ERROR] /home/jitpack/build/src/main/java/zmq/socket/scattergather/Scatter.java:[21,27] cannot find symbol
[ERROR]   symbol:   variable ZMQ_SCATTER
[ERROR]   location: class zmq.ZMQ
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
Found artifact: org.zeromq:jeromq:0.5.3-SNAPSHOT
2021-01-03T23:46:24.784944587Z
Exit code: 0

I'm assuming that the reason is that these sockets aren't implemented yet in jeromq?

@richardwei6
Copy link
Author

richardwei6 commented Jan 4, 2021

Ok so I tried manually merging it and I managed to get it to compile without any errors. The version is now v0.5.8. You can find it here: https://jitpack.io/#richardwei6/jeromq and https://github.com/richardwei6/jeromq

The issue is, I'm now still getting Protocol not supported when trying to bind the address.

@fbacchella
Copy link
Contributor

yes, it does not implement protocol, but it reduce the amount of code to written, it's juste a simple class, that can even be added at runtime. So different implementation can be used for Android or server. It also allows to easily add unix sockets for people running on Java 16.

@richardwei6
Copy link
Author

yes, it does not implement protocol, but it reduce the amount of code to written, it's juste a simple class, that can even be added at runtime. So different implementation can be used for Android or server. It also allows to easily add unix sockets for people running on Java 16.

I'm still a little confused, what is this class you're talking about? I've looked up how to implement UDP in Java and found this: https://www.geeksforgeeks.org/working-udp-datagramsockets-java/. Is this the class you're talking about? If so, how would I go about implementing this?

@somdoron
Copy link
Member

somdoron commented Jan 4, 2021

@richardwei6 UDP is not yet implemented in JeroMQ, what @fbacchella suggests an easier way to add UDP support.

If you want I can try to give you guidelines (and support) on how to port it to JeroMQ (I added the UDP protocol to libzmq)

@richardwei6
Copy link
Author

@richardwei6 UDP is not yet implemented in JeroMQ, what @fbacchella suggests an easier way to add UDP support.

If you want I can try to give you guidelines (and support) on how to port it to JeroMQ (I added the UDP protocol to libzmq)

Yea that would definitely be helpful!

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

4 participants