Git Product home page Git Product logo

zenoh-kotlin's People

Contributors

dariusimp avatar eclipse-zenoh-bot avatar fuzzypixelz avatar jenoch avatar kydos avatar mallets avatar olivierhecart avatar p-avital avatar yuanyuyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zenoh-kotlin's Issues

Examples parameters

Describe the feature

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.

[Bug] Document destructors

Describe the bug

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

To reproduce

N/A

System info

N/A

Should `zenoh-jni` be packaged on Debian?

Describe the release item

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.

Automated snapshot packages publication

Describe the release item

Context

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.

Solution

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.

Requesting amd64 support for JVM library

Describe the feature

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

[Bug] Subscriber closes after starting a server

Describe the bug

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

To reproduce

  1. Create subscriber
  2. Start server
  3. Subscriber is getting closed

System info

  • Zenoh: 0.10.1-rc
  • Jetty: 12.0.6
  • Kotlin: 1.9.22
  • Java: 21
  • CPU: Apple M3 Pro

Should `zenoh-jni` be packaged on Debian?

Describe the release item

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.

[Bug] Failure loading windows library

Describe the bug

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)

To reproduce

Create a project using the SNAPSHOT package of Zenoh-Kotlin.

Attempt to start a session.

System info

  • Windows
  • amd64 architecture

Pull subscriber implementation

Describe the release item

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.