Troubleshooting

The following troubleshooting tips might help you to resolve issues with this Micro-Integration. If problems persist, contact Solace.

Connection Failures

If the Micro-Integration cannot connect to MongoDB:

  • Verify that the connection string is a valid MongoDB URI (for example, mongodb://host:27017) and that the host and port are reachable from the environment where the Micro-Integration is running.

  • Check that no firewall rules are blocking outbound connections to the MongoDB host on the configured port.

  • If connecting to a replica set or sharded cluster, confirm that all hostnames in the connection string are resolvable from the Micro-Integration host.

Authentication Errors

If the Micro-Integration logs an authentication error or fails to connect with an authorization failure:

  • Verify that the username and password are correct for the configured authentication database.

  • Check that the mongodb.auth-database value in your application.yml matches the database where the user account is defined. The default is admin.

  • Confirm that the user has write permissions on the target collection's database.

TLS Connection Errors

If the Micro-Integration logs TLS handshake failures or certificate errors when using TLS Authentication:

  • Verify that the trust store path configured in mongodb.trust-store-path is a valid PKCS12 file containing the CA certificate that signed the MongoDB server's certificate.

  • Confirm that the trust store password is correct.

  • If using mutual TLS, verify that the key store file contains a valid client certificate and private key, and that the key store password is correct.

  • Check that the server certificate has not expired. If it has, replace it and update the trust store.

Collection Not Found or Destination Format Errors

If the Micro-Integration logs errors about an invalid or missing collection:

  • Verify that the destination configured in your application.yml uses database.collection format (for example, mydb.events). Both the database name and collection name are required.

  • Confirm that the database and collection exist in MongoDB. The Micro-Integration does not create databases or collections automatically.

  • If using the scst_targetDestination header for dynamic routing, verify that the header value is also in database.collection format.

Unsupported Payload Type Errors

If the Micro-Integration rejects messages with an IllegalArgumentException or an unsupported payload error:

  • Verify that the message payload is one of the supported types: a Map<String, Object>, a single-element List, a JSON object or single-element JSON array as a String, or a JSON object or single-element JSON array as a UTF-8 byte[].

  • If the payload is a List, check that it contains exactly one element. Empty lists and lists with more than one element are not supported.

  • If the payload is a Map, confirm that all map keys are of type String.

Payload Too Large Errors

If the Micro-Integration rejects messages due to payload size:

  • Check that JSON String and JSON Bytes payloads do not exceed 2 MB. Messages larger than this limit are not supported.

  • If large payloads are expected, consider splitting the data into smaller messages before publishing to the event broker.