<Loggers>
...
<AsyncLogger name="com.mulesoft.connectors.ws" level="DEBUG"/>
...
</Loggers>
Troubleshooting WebSockets Connector - Mule 4
To troubleshoot Anypoint Connector for WebSockets (WebSockets Connector), become familiar with the information about enabling verbose logging and interpreting commonly thrown messages.
Enable Verbose Logging
To get a better understanding of why an application’s interaction with WebSockets Connector is failing, temporarily enable verbose logging for the connector.
Remember to always disable the enhanced verbosity after troubleshooting because it affects your Mule application performance.
To enable verbose logging in the configuration file:
-
Access Anypoint Studio and navigate to the Package Explorer view.
-
Open your application’s project name.
-
Open the
src/main/resources
path folder. -
Open the
log4j2.xml
file inside the folder. -
Add an
<AsyncLogger>
tag inside the<Loggers>
tag: -
Save your application changes.
-
Click the project name in Package Explorer and then click Run > Run As > Mule Application.
Understand Common Throws
Here is a list of common throw messages and how to interpret them:
-
WEBSOCKET:CONNECTIVITY
The connection is no longer valid. Apply a reconnection policy if defined in the application setup.
-
WEBSOCKET:RETRY_EXHAUSTED
The maximum number of retries for the operation is reached.
-
WEBSOCKET:NO_SUCH_SOCKET
The WebSocket cannot be referenced because the WebSocket ID does not exist.
-
WEBSOCKET:BASIC_AUTHENTICATION
The HTTP *Request* operation lacks basic authentication to send requests to the service, or the provided credentials are incorrect.
-
WEBSOCKET:FORBIDDEN
The server refuses to give the requested resource because the client does not have access rights to the content.
-
WEBSOCKET:INTERNAL_SERVER_ERROR
The server encountered a problem that prevented it from fulfilling the request.
-
WEBSOCKET:INVALID_SOCKET_ID
The WebSocket ID is null or blank.
-
WEBSOCKET:NON_UNIQUE_SOCKET_ID
An error occurred while registering the WebSocket because the ID already exists.
-
WEBSOCKET:NOT_FOUND
The server could not find the requested resource.
-
WEBSOCKET:REMOTELY_CLOSED
The remote host closed the connection, which could be related to an SSL/TLS handshake issue. Check protocols, cipher suites, and certificate setup. Use -Djavax.net.debug=ssl for further debugging.
-
WEBSOCKET:SERVICE_UNAVAILABLE
The server is unable to manage the request because it is down for maintenance or overloaded.
-
WEBSOCKET:UNAUTHORIZED
The authentication failed or has not yet been provided to get the requested response.