JAVA WAMP server

Hi all,
thank you for that great tool.
I can’t find is it possible to use normal Web Socket server or I must implement something special so I can use the WAMP-java client ?
To be more clearly - I am asking for sample code in java to get server and client/s work .
Till now I’ve started one WAMP Router instance with docker on new virtual machine, but can’t connect clients …
After that I’ll need to call procedure on one client from the server that will respond with result …

It will be great if you can provide some example code .
Thank you .

Regards

I found the problem :
the URL must be with /ws at the end …
so the fool URL must be “ws://yourIpAddress:port/ws”
example “ws://127.0.0.1:8080/ws”
then I got connected.

Hello,
I’ve setup WAMP router with docker and after starting Java Client and trying to connect I receive that debugger info :

0 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.logging.InternalLoggerFactory  - Using Log4J as the default logging framework
3 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.InternalThreadLocalMap  - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
3 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.InternalThreadLocalMap  - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
25 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.handler.ssl.OpenSsl  - netty-tcnative not in the classpath; OpenSslEngine will be unavailable.
265 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - -Dio.netty.noUnsafe: false
265 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - Java version: 8
266 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - sun.misc.Unsafe.theUnsafe: available
267 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - sun.misc.Unsafe.copyMemory: available
267 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - java.nio.Buffer.address: available
267 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - direct buffer constructor: available
268 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - java.nio.Bits.unaligned: available, true
268 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
268 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent0  - java.nio.DirectByteBuffer.<init>(long, int): available
268 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - sun.misc.Unsafe: available
269 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
269 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.bitMode: 64 (sun.arch.data.model)
269 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.maxDirectMemory: 3717201920 bytes
270 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.uninitializedArrayAllocationThreshold: -1
271 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.CleanerJava6  - java.nio.ByteBuffer.cleaner(): available
271 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - -Dio.netty.noPreferDirect: false
274 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.handler.ssl.JdkSslContext  - Default protocols (JDK): [TLSv1.2, TLSv1.1, TLSv1] 
274 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.handler.ssl.JdkSslContext  - Default cipher suites (JDK): [TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA]
301 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.channel.MultithreadEventLoopGroup  - -Dio.netty.eventLoopThreads: 8
327 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.channel.nio.NioEventLoop  - -Dio.netty.noKeySetOptimization: false
327 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.channel.nio.NioEventLoop  - -Dio.netty.selectorAutoRebuildThreshold: 512
337 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.internal.PlatformDependent  - org.jctools-core.MpscChunkedArrayQueue: available
361 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.channel.DefaultChannelId  - -Dio.netty.processId: 19588 (auto-detected)
363 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.NetUtil  - -Djava.net.preferIPv4Stack: false
363 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.NetUtil  - -Djava.net.preferIPv6Addresses: false
365 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.NetUtil  - Loopback interface: lo (lo, 0:0:0:0:0:0:0:1%lo)
365 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.NetUtil  - /proc/sys/net/core/somaxconn: 128
367 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.channel.DefaultChannelId  - -Dio.netty.machineId: 00:50:56:ff:fe:c0:00:08 (auto-detected)
379 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.ResourceLeakDetector  - -Dio.netty.leakDetection.level: simple
379 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.util.ResourceLeakDetector  - -Dio.netty.leakDetection.targetRecords: 4
400 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.numHeapArenas: 8
400 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.numDirectArenas: 8
400 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.pageSize: 8192
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.maxOrder: 11
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.chunkSize: 16777216
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.tinyCacheSize: 512
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.smallCacheSize: 256
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.normalCacheSize: 64
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.cacheTrimInterval: 8192
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.useCacheForAllThreads: true
401 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.PooledByteBufAllocator  - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
406 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.allocator.type: pooled
406 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.threadLocalDirectBufferSize: 0
406 [ForkJoinPool.commonPool-worker-1] DEBUG io.netty.buffer.ByteBufUtil  - -Dio.netty.maxThreadLocalCharBufferSize: 16384
449 [nioEventLoopGroup-2-1] DEBUG io.netty.buffer.AbstractByteBuf  - -Dio.netty.buffer.checkAccessible: true
450 [nioEventLoopGroup-2-1] DEBUG io.netty.buffer.AbstractByteBuf  - -Dio.netty.buffer.checkBounds: true
450 [nioEventLoopGroup-2-1] DEBUG io.netty.util.ResourceLeakDetectorFactory  - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@35eb57b0
461 [nioEventLoopGroup-2-1] DEBUG io.netty.handler.codec.compression.ZlibCodecFactory  - -Dio.netty.noJdkZlibDecoder: false
462 [nioEventLoopGroup-2-1] DEBUG io.netty.handler.codec.compression.ZlibCodecFactory  - -Dio.netty.noJdkZlibEncoder: false
511 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler  - -Dio.netty.recycler.maxCapacityPerThread: 4096
512 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler  - -Dio.netty.recycler.maxSharedCapacityFactor: 2
512 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler  - -Dio.netty.recycler.linkCapacity: 16
512 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler  - -Dio.netty.recycler.ratio: 8
525 [nioEventLoopGroup-2-1] DEBUG io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13  - WebSocket version 13 client handshake key: v0/fl5QhtaxPb2Nh/Mg3eQ==, expected response: 97HN0AEdhSdtcwjmVhQAjn/oBy4=
Jan 15, 2020 10:09:19 AM io.crossbar.autobahn.wamp.transports.NettyWebSocketClientHandler
INFO: WebSocket Client disconnected!
Jan 15, 2020 10:09:19 AM com.intersoftpro.testapp.ExampleClient onDisconnectCallback
INFO: Session with ID=0, disconnected.

Some help please :slight_smile:
I tried all the steps from your how to start guide but no result

The crossbar console prints that :

2020-01-15T08:09:19+0000 [Router         17] received invalid HTTP request line for HTTP protocol subswitch: "b'\x16\x03\x03\x00x\x01\x00\x00t\x03\x03^\x1e\xc8\xaf\x8cw\xa9\xd8\xef\x1a\x96\xaf\x8d\xeb\x1d\x1a\xdf%"\x96}\xbdb\xff\xae)\xe80\xca\x1f\xdd\xa1\x00\x00\x10\xc0,\xc0+\xc0/\xc0\x13\xc0\x14\x00\x9c\x00/\x005\x01\x00\x00;\x00\n\x00\x08\x00\x06\x00\x17\x00\x18\x00\x19\x00\x0b\x00\x02\x01\x00\x00\r\x00\x1c\x00\x1a\x06\x03\x06\x01\x05\x03\x05\x01\x04\x03\x04\x01\x04\x02\x03\x03\x03\x01\x03\x02\x02\x03\x02\x01\x02\x02\x00\x17\x00\x00\xff\x01\x00\x01'"

not sure if that helps, but the CI in the AutobahnJava repo runs a Netty based component against crossbar: https://travis-ci.org/crossbario/autobahn-java/jobs/636888099#L2818

@om26er ^ any hints?

Can you please share your client code, it would also be helpful if you could share the crossbar config as well. Seems to me like a URL issue but we’ll know more once I have the client code.

PS: I just tried https://github.com/crossbario/autobahn-java#getting-started and things just worked.