eclipse-zenoh / zenoh-kotlin Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Unlike with other Zenoh bindings examples, for the Kotlin ones we do not yet support parameters.
For instance, we should allow to run commands like gradle ZPub -e tcp/localhost:8080
or gradle ZPub -c config.json5
.
Due to the use of destructors which is uncommon in JVM languages, users may get confused as to why their subscribers stop functioning. This needs to be better documented. @da
N/A
N/A
The zenoh-jni
Cargo manifest has a Debian package manifest. No zenoh-jni
Debian package was made so far. If we don't plan on changing that any time soon, then the manifest should be removed as it is confusing from a scripting perspective.
In light of the forthcoming Zenoh 1.0.0 release, the project should make sure the naming convention is properly followed for packages.
Changes done on the codebase for both Kotlin and Java bindings are not published until the next release is performed. This causes that fixes or new features that are already in the codebase and ready to be used are not available for users, unless they install the repository and do the whole setup consisting on publishing locally the library.
Modifying the github workflows to automatically publish snapshot packages from the main branch, providing the users packages with the last version changes on the codebase.
Github packages provides support for such kind of packages, overriding old snapshot versions.
I tried running a simple example with zenoh-kotlin-jvm (0.10.1-rc) today but got this error:
Exception in thread "main" java.lang.UnsupportedOperationException: Unsupported architecture: amd64
at io.zenoh.Zenoh$Companion.determineTarget-d1pmJ48(Zenoh.kt:53)
at io.zenoh.Zenoh$Companion.access$determineTarget-d1pmJ48(Zenoh.kt:29)
at io.zenoh.Zenoh.<init>(Zenoh.kt:160)
at io.zenoh.Zenoh.<init>(Zenoh.kt)
at io.zenoh.Zenoh$Companion.load(Zenoh.kt:36)
at io.zenoh.Session.<init>(Session.kt:81)
at io.zenoh.Session.<init>(Session.kt)
at io.zenoh.Session$Companion.open-d1pmJ48(Session.kt:64)
I noticed that amd64
is not in the list of supported architectures for the JVM library. ๐
I did manage to build the zenoh repository itself without a problem and managed to run the examples. Any reasoning why the JVM library does not support amd64?
System information:
Windows 10
Processor 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz, 2304 Mhz, 8 Core(s), 16 Logical Processor(s)
C:\Users\***>echo %PROCESSOR_ARCHITECTURE%
AMD64
I've faced with an issue that zenoh subscribers are getting closed after starting a web-server (tried with spring-boot-tomcat, spring-boot-jetty, pure jetty).
You can use following simple code to reproduce it:
import io.zenoh.Config
import io.zenoh.Session
import io.zenoh.keyexpr.intoKeyExpr
import org.eclipse.jetty.server.Server
fun main(args: Array<String>) {
val config = Config.Companion.from(
"""
{
"mode": "client",
"connect": {
"endpoints": ["tcp/localhost:7447"]
}
}
""".trimIndent()
)
Session.open(config).fold(
onSuccess = { session ->
session.use {
"test/test".intoKeyExpr().fold(
onSuccess = { keyExpr ->
keyExpr.use {
session.declareSubscriber(keyExpr)
.onClose { println("ON CLOSE CALLBACK IS CALLED") }
.reliable()
.with { println(String(it.value.payload)) }
.res()
.fold(
onSuccess = { println("Successfully subscribed") },
onFailure = { println("Failed to subscribe") }
)
}
},
onFailure = { println("Failed to get key expression") }
)
}
},
onFailure = { println("Failed to open session") }
)
Server(8080).apply {
start()
join()
}
}
Seems like the issue not at jetty itself as different implementations of servers don't work, but in the way how servers threading lifecycle work.
Here are the logs:
Successfully subscribed
ON CLOSE CALLBACK IS CALLED
00:07:39.548 [main] INFO org.eclipse.jetty.server.Server - jetty-12.0.6; built: 2024-01-30T02:43:24.387Z; git: 78ab6e6ba163f89cdd97f2ae0283fbb5e371cfaf; jvm 21.0.2+13-58
00:07:39.562 [main] INFO o.e.jetty.server.AbstractConnector - Started ServerConnector@6d40861d{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
00:07:39.568 [main] INFO org.eclipse.jetty.server.Server - Started oejs.Server@5acf93bb{STARTING}[12.0.6,sto=0] @1133ms
The zenoh-jni
Cargo manifest has a Debian package manifest. No zenoh-jni
Debian package was made so far. If we don't plan on changing that any time soon, then the manifest should be removed as it is confusing from a scripting perspective.
Zenoh now supports user attachments since eclipse-zenoh/zenoh#613. All Zenoh bindings now need to provide support for this new feature.
On windows, we get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\....\AppData\Local\Temp\tempLib10649058771145031396: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at io.zenoh.Zenoh$Companion.loadZenohJNI(Zenoh.kt:125)
at io.zenoh.Zenoh$Companion.tryLoadingLibraryFromJarPackage-IoAF18A(Zenoh.kt:137)
at io.zenoh.Zenoh$Companion.access$tryLoadingLibraryFromJarPackage-IoAF18A(Zenoh.kt:29)
at io.zenoh.Zenoh.<init>(Zenoh.kt:161)
at io.zenoh.Zenoh.<init>(Zenoh.kt)
at io.zenoh.Zenoh$Companion.load(Zenoh.kt:36)
at io.zenoh.Session.<init>(Session.kt:81)
at io.zenoh.Session.<init>(Session.kt)
at io.zenoh.Session$Companion.open-d1pmJ48(Session.kt:64)
Create a project using the SNAPSHOT package of Zenoh-Kotlin.
Attempt to start a session.
So far the experimental versions of the Kotlin/Java bindings have missed the pull subscriber feature. For the sake of API alignment, the pull subscriber for these bindings need to be implemented.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.