Hi @alexhultman. Do you mind posting your config file?
The URL you use has to match the <accept> line of your service. So if it says, for example, ws://localhost:8000/echo
then that is the address your client has to use.
There are options, depending on what you want to do. If you simply want to address your host directly, then either replace that <accept>
or add another one. (You can have multiple <accept>
statements.)
So you could add another one like this: <accept>ws://myhostname:8080</accept>
. Then you can connect to both the localhost
address or the myhostname
address.
my conf/gateway-config-minimal looks like this:
<service>
<name>echo</name>
<description>Simple echo service</description>
<accept>ws://${gateway.hostname}:${gateway.base.port}/echo</accept>
<type>echo</type>
</service>
<service>
<name>echo</name>
<description>Simple echo service</description>
<accept>ws://${gateway.hostname}:${gateway.port}/echo</accept>
<type>echo</type>
<!-- Restrict cross site constraints before running in production -->
<cross-site-constraint>
<allow-origin>*</allow-origin>
</cross-site-constraint>
</service>
<cross-site-constraint>
to your service.
Hi @alexhultman.
the server seems to be multithreaded by default
I have 30 accepts because I have 30 localhost addresses
when I stress the server it uses multiple cores, can I force it to use only one?
The server is NIO based. You can pin to the number of cores you want want with a -D
parameter. For example, set the GATEWAY_OPTS
environment variable prior to starting the gateway:
export GATEWAY_OPTS='-Dorg.kaazing.gateway.server.transport.tcp.PROCESSOR_COUNT=1'
from what I have found, the server is very slow
is the Community edition slower than the main product?
The Enterprise Gateway is layered on top of the Community Gateway and adds some features. Functionally there are more features in Enterprise Edition, but from a performance perspective they are same.
If you can describe what you're doing and what you're trying to achieve, perhaps we can make some suggestions.
I also need to echo 100mb, it doesn't allow that by default
The gateway limits the inbound message size by default to prevent a denial of service attack that sends large payloads. You can change the value to something larger using ws.maximum.message.size
:
As an alternative, you can also have the echo service echo back multiple times for each message it receives. In the following example, the echo service will send the message 10 times using the <repeat>
property:
<service>
<name>echo</name>
<description>Simple echo service</description>
<accept>ws://${gateway.hostname}:${gateway.port}/echo</accept>
<type>echo</type>
<properties>
<repeat>10</repeat>
</properties>
<!-- Restrict cross site constraints before running in production -->
<cross-site-constraint>
<allow-origin>*</allow-origin>
</cross-site-constraint>
</service>
This way you can send a small message to the echo service, but have it send back a larger amount of data.