Open Source API Gateway

400 Bad Request: Error in STOMP Client

Membrane API Gateway returns 400 Bad Request with the detail Error in STOMP client! when the stompClient plugin cannot forward a STOMP connect request to the broker because of an I/O error.

The Error Response

The response contains the status 400 Bad Request, the detail Error in STOMP client!, the problem type https://membrane-api.io/problems/user and a link to this page. Despite the type user and the status 400, the client is not at fault. The error describes a connection problem between the gateway and the STOMP broker.

What the STOMP Client Does

The stompClient plugin connects Membrane to a STOMP message broker, such as ActiveMQ or RabbitMQ, at the configured host and port (default 61613) and forwards STOMP frames to it. Outbound TLS and connection parameters can be configured on the plugin.

Common Causes

The Broker Is Not Reachable

The broker at the configured host and port refuses the connection, the host name cannot be resolved, or the connection attempt times out. Check that the broker is running and that no firewall blocks the port.

The TLS Handshake Failed

With outbound TLS configured, the handshake with the broker failed, for example because the broker's certificate is not trusted or the broker does not speak TLS on that port.

The Connection Broke

The connection was closed while the request was written to the broker, for example because the broker restarted.

How to Fix It

  1. Check that the broker is running and reachable from the gateway host at the configured host and port.
  2. Check the outbound TLS configuration and the connection settings of stompClient, for example the timeout.
  3. Check the gateway log. The underlying I/O error is logged at error level with its stack trace.

Hide Details in Production

By default, Membrane runs in development mode and adds details to error responses that help you find the problem. These details may reveal information about your setup. In production, turn them off:

configuration:
production: true
configuration:
  production: true

Add the configuration document to your apis.yaml and separate it from the APIs with ---.

Related Documentation

Configuration reference:

← All Membrane error messages

Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.