Closed jnorthrup closed 3 years ago
I will have to check it out tomorrow, I am not sure if I will have time today. Can you check if it works for 1.5.30 in the meantime?
There seems to be an issue with artifacts of newer versions...
You can use version 0.2.1 in the meantime (be sure not to drop out the jvm
part, it is required when using maven):
<dependency>
<groupId>com.ensarsarajcic.kotlinx</groupId>
<artifactId>serialization-msgpack-jvm</artifactId>
<version>0.2.1</version>
</dependency>
I will try to resolve this and I will hopefully release version 0.4.1 with the fix soon.
much appreciated. msgpack is my first choice but i switched tracks to json since posting this for stubbing in the serde stuff
Fix is available in version 0.4.1, which is now available on Maven Central.
looks like Pair is unimpl in fromByteArray ?
the pom:
https://gitlab.com/jnorthrup1/GardenKollektion/-/blob/main/gk-agent/pom.xml
the minimum possible testcase:
import com.ensarsarajcic.kotlinx.serialization.msgpack.MsgPack
import junit.framework.TestCase
import kotlinx.serialization.decodeFromByteArray
import kotlinx.serialization.encodeToByteArray
import java.nio.ByteBuffer
typealias ReifiedMessage = Pair<List<Pair<String, String>>, String>
val debug = { }
fun send(event: ReifiedMessage) =
ByteBuffer.wrap(MsgPack.Default.encodeToByteArray(event))
fun recv(ser: ByteBuffer): ReifiedMessage {
val byteArray = ByteArray(ser.remaining())
ser.put(byteArray)
val decodeFromByteArray = MsgPack.Default.decodeFromByteArray<ReifiedMessage>(byteArray)
debug()
return decodeFromByteArray
}
class SmMsgPackTest : TestCase() {
// val sm1: SimpleMessage = _v["Alice" t2 "Bob",
// "Charley" t2 "Delta"] t2 "Random message Body here"
// fun testMsgPack() {
// val byteBuffer = SmMsgPack.send(sm1)
// debug{}
// val done=SmMsgPack.recv(byteBuffer!!)
// debug{}
// }
val sm1:ReifiedMessage = listOf("Alice" to "Bob", "Charley" to "Delta") to "Random message Body here"
fun testMsgPack() {
val byteBuffer = send(sm1)
debug()
val done = recv(byteBuffer!!)
debug()
}
}
fun main() {
SmMsgPackTest().testMsgPack()
}
I have created a separate issue for this (#57). Thanks for reporting!
It seems the issue is deserialization of nested structures or anything more complex. Fix will be released in 0.4.2 soon!
possible manifest incompatibility with maven?
I am using maven, and maven can find the jarfiles on maven central, however nothing i do can get these to import in 1.6.0M1 for a jvm project.