Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vincent Charpentier
ZmqpubsubJava
Commits
b0c5ae8d
Commit
b0c5ae8d
authored
Apr 28, 2022
by
Vincent Charpentier
Browse files
feat: starting with creating the ZMQ Java package.
parent
f47cd10d
Changes
5
Hide whitespace changes
Inline
Side-by-side
.idea/.gitignore
0 → 100644
View file @
b0c5ae8d
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
.idea/misc.xml
0 → 100644
View file @
b0c5ae8d
<?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
.idea/vcs.xml
0 → 100644
View file @
b0c5ae8d
<?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
src/main/java/Main.java
View file @
b0c5ae8d
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
)
+
"]"
);
}
}
}
}
src/main/java/zmqpubsub/ZmqPublisher.java
0 → 100644
View file @
b0c5ae8d
package
zmqpubsub
;
public
class
ZmqPublisher
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment