Hi Andy and Christian,
This is tangential to the original question, though I’ll share this in case it
helps others.
I recently needed to solve “URI Too Long” errors that were encountered when the
value of a query parameter in an HTTP GET request to a RESTXQ function exceeded
a preset maximum length. Fortunately, there is a way to configure a higher
limit by setting requestHeaderSize in jetty.xml as shown below.
I also wanted to be able to configure (and find out) the HTTP port for Jetty
using a system property, and had to add a SystemProperty element in jetty.xml
as shown below.
This is using BaseX version 11.9 which has Jetty version 11.0.25. I’ll have to
try using BaseX 12 soon.
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- increase max header size to resolve errors: "URI Too Long" and "WARN
org.eclipse.jetty.http.HttpParser - URI is too large >8192" -->
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Set name="requestHeaderSize">65536</Set>
</New>
<!-- Default connector. The Jetty stop port can be specified
in the .basex or pom.xml configuration file. -->
<Call name="addConnector">
<Arg>
<New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server"><Ref refid="Server"/></Arg>
<Arg name="factories">
<Array type="org.eclipse.jetty.server.ConnectionFactory">
<Item>
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
<Arg name="config">
<Ref refid="httpConfig"/>
</Arg>
</New>
</Item>
</Array>
</Arg>
<Set name="host">0.0.0.0</Set>
<Set name="port"><SystemProperty name="jetty.http.port"
default="8080"/></Set>
<Set name="idleTimeout">60000</Set>
<Set name="reuseAddress">true</Set>
</New>
</Arg>
</Call>
</Configure>
I might have opted to use POST instead of GET for the RESTXQ function without
needing to increase requestHeaderSize, but I was calling the RESTXQ function
from XSLT using the doc() function.
Kind regards,
Vincent
_____________________________________________
Vincent M. Lizzi
Head of Information Standards | Taylor & Francis Group
[email protected]<mailto:[email protected]>
Time zone: US Eastern
[https://res.public.onecdn.static.microsoft/assets/bookwithme/misc/CalendarPerson20px.png]<https://outlook.office.com/bookwithme/user/[email protected]?anonymous&ep=owaSlotsEmailSignature>
Book time to meet with
me<https://outlook.office.com/bookwithme/user/[email protected]?anonymous&ep=owaSlotsEmailSignature>
Information Classification: General
From: Andy Bunce <[email protected]>
Sent: Monday, August 4, 2025 5:55 PM
To: Christian Grün <[email protected]>
Cc: BaseX <[email protected]>
Subject: [basex-talk] Re: Websocket configuration Basex 12
Hi Christian,
Thanks for this. It sounds like a good approach and it is working for me with
the latest release.
/Andy
On Mon, 4 Aug 2025 at 15:36, Christian Grün
<[email protected]<mailto:[email protected]>> wrote:
Hi Andy,
I wanted to introduce new options first, but I dropped this approach, and I
decided to simulate the old behavior of Jetty. The init-param entries in the
web.xml file are now parsed by BaseX and assigned to the WebSocket instance
when the first WebSocket connection is created [1].
As a consequence, existing Jetty 9 web.xml WebSocket configurations should work
again. Feel free to check out the latest snapshot [2] to verify if that’s true.
Best,
Christian
PS: The docs have been updated, too [3].
[1]
https://github.com/BaseXdb/basex/commit/880535ed23d11c15b58945d12049242af65486f1<https://github.com/BaseXdb/basex/commit/880535ed23d11c15b58945d12049242af65486f1>
[2]
https://files.basex.org/releases/latest/<https://files.basex.org/releases/latest/>
[3]
https://docs.basex.org/main/WebSockets#configuration<https://docs.basex.org/main/WebSockets#configuration>
________________________________
Von: Andy Bunce <[email protected]<mailto:[email protected]>>
Gesendet: Montag, 4. August 2025 00:39
An: BaseX
<[email protected]<mailto:[email protected]>>
Betreff: [basex-talk] Websocket configuration Basex 12
Hi,
I would like to increase the websocket message length from the default of 64 KB.
The websocket documentation implies this can be done via web.xml [1]
However, while searching for the syntax I came across the suggestion it is
different with the Jetty version 12 API [2]
The Jetty docs have this example [3]
// Configure the ServerContainer.
container.setDefaultMaxTextMessageBufferSize(128 * 1024);
but my quick code search of the BaseX source found nothing similar.
Is it possible to configure the webSocket MaxTextMessageBufferSize in BaseX
12.0?
/Andy
[1]
https://docs.basex.org/main/WebSockets#configuration<https://docs.basex.org/main/WebSockets#configuration>
[2]
https://stackoverflow.com/questions/79610426/setting-the-max-buffer-size-for-websocketclient-since-upgrading-to-jetty-12<https://stackoverflow.com/questions/79610426/setting-the-max-buffer-size-for-websocketclient-since-upgrading-to-jetty-12>
[3]
https://jetty.org/docs/jetty/12/programming-guide/server/websocket.html#standard-endpoints<https://jetty.org/docs/jetty/12/programming-guide/server/websocket.html#standard-endpoints>