Commit b0c5ae8d authored by Vincent Charpentier's avatar Vincent Charpentier
Browse files

feat: starting with creating the ZMQ Java package.

parent f47cd10d
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" default="true" project-jdk-name="openjdk-15" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import org.zeromq.SocketType;
import org.zeromq.ZMQ;
import org.zeromq.ZContext;
public class Main
{
public static void main(String[] args) {
public static void main(String[] args) throws Exception
{
try (ZContext context = new ZContext())
{
ZMQ.Socket socket = context.createSocket(SocketType.PUB);
socket.bind("tcp://*:5555");
while (!Thread.currentThread().isInterrupted())
{
System.out.println("waiting for message");
byte[] reply = socket.recv(0);
// Print the message
System.out.println("Received: [" + new String(reply, ZMQ.CHARSET) + "]"
);
}
}
}
}
package zmqpubsub;
public class ZmqPublisher
{
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment