quarkusio/quarkus · error · WebSocketClientException
Unable to obtain the config value for:
Error message
Unable to obtain the config value for:
What it means
When the WebSocket client endpoint has no programmatic base URI and no per-client quarkus.websocket.<client-id>.base-uri config property is set, WebSocketConnectorImpl.connect() fails while resolving the server endpoint URI and throws this WebSocketClientException naming the config key.
Source
Thrown at extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorImpl.java:74
setPath(clientEndpoint.path);
}
@Override
public Uni<WebSocketClientConnection> connect() {
// A new client is created for each connection
// The client is created when the returned Uni is subscribed
// The client is closed when the connection is closed
AtomicReference<WebSocketClient> client = new AtomicReference<>();
StringBuilder serverEndpoint = new StringBuilder();
if (baseUri != null) {
serverEndpoint.append(baseUri.toString());
} else {
// Obtain the base URI from the config
String key = clientEndpoint.clientId + ".base-uri";
Optional<String> maybeBaseUri = ConfigProvider.getConfig().getOptionalValue(key, String.class);
if (maybeBaseUri.isEmpty()) {
throw new WebSocketClientException("Unable to obtain the config value for: " + key);
}
serverEndpoint.append(maybeBaseUri.get());
}
serverEndpoint.append(replacePathParameters(clientEndpoint.path));
URI serverEndpointUri;
try {
serverEndpointUri = new URI(serverEndpoint.toString());
} catch (URISyntaxException e) {
throw new WebSocketClientException(e);
}
WebSocketConnectOptions connectOptions = newConnectOptions(serverEndpointUri);
StringBuilder uri = new StringBuilder();
if (serverEndpointUri.getPath() != null) {
uri.append(serverEndpointUri.getRawPath());
}
if (serverEndpointUri.getQuery() != null) {View on GitHub (pinned to e1c734241f)
Solutions
- Add quarkus.websocket.<client-id>.base-uri=ws://host:port to application.properties (client-id matches @WebSocketClient clientId or endpoint class-derived id)
- Call baseUri(URI) on the connector programmatically before connect()
- Verify the client-id used in the property key is correct
- Check the property is present in the active profile (e.g. %test)
Example fix
// before
connector.connect(); // no base-uri configured
// after (application.properties)
quarkus.websocket.my-client.base-uri=ws://localhost:8080
// or programmatically
connector.baseUri(URI.create("ws://localhost:8080")).connect(); Defensive patterns
Strategy: validation
Validate before calling
String key = clientId + ".base-uri"; boolean configured = ConfigProvider.getConfig().getOptionalValue(key, String.class).isPresent(); // or check programmatically before connect(); otherwise call connector.baseUri(...)
Try / catch
try {
connector.connect();
} catch (WebSocketClientException e) {
if (e.getMessage().contains(".base-uri")) {
log.error("Set {} in application.properties or call baseUri()", clientId + ".base-uri", e);
}
} Prevention
- Always set quarkus.websocket.<client-id>.base-uri when not calling baseUri() programmatically
- Verify client-id spelling in property keys
- Check the property exists in every active profile (prod, dev, test)
When it happens
Trigger: Calling connect() on a WebSocketConnector for an endpoint that (a) had no baseUri() call on the connector and (b) has no quarkus.websocket.<client-id>.base-uri property in application.properties/yaml — including wrong client-id in the key or property not visible at runtime.
Common situations: Missing application.properties entry; client-id mismatch between annotation and config key; config not included in the build (wrong profile, missing file); test profile lacking the property.
Related errors
- Endpoint URI not set!
- client-id, client-secret and introspection-url must be confi
- Proxy configuration with name ${key} was requested but quark
- No URL specified. Cannot build a rest client without URL
- Unable to determine the proper baseUrl/baseUri. Consider reg
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/684d4bbf229308dc.
Report an issue: GitHub.