{"record":{"id":"38bd4a12c0419478","repo":"apache/beam","slug":"solaceio-response-from-semp-is-empty","errorCode":null,"errorMessage":"SolaceIO: response from SEMP is empty!","messagePattern":"SolaceIO: response from SEMP is empty!","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/broker/SempBasicAuthClientExecutor.java","lineNumber":93,"sourceCode":"  public SempBasicAuthClientExecutor(\n      String host,\n      String username,\n      String password,\n      String vpnName,\n      HttpRequestFactory httpRequestFactory) {\n    this.baseUrl = String.format(\"%s/SEMP/v2\", host);\n    this.username = username;\n    this.messageVpn = vpnName;\n    this.password = password;\n    this.requestFactory = httpRequestFactory;\n    this.cookieManagerKey = new CookieManagerKey(this.baseUrl, this.username);\n    COOKIE_MANAGER_MAP.computeIfAbsent(this.cookieManagerKey, key -> new CookieManager());\n  }\n\n  public boolean isQueueNonExclusive(String queueName) throws IOException {\n    BrokerResponse response = getQueueResponse(queueName);\n    if (response.content == null) {\n      throw new IOException(\"SolaceIO: response from SEMP is empty!\");\n    }\n    Queue q = mapJsonToClass(response.content, Queue.class);\n    return q.data().accessType().equals(\"non-exclusive\");\n  }\n\n  private static String getQueueEndpoint(String messageVpn, String queueName)\n      throws UnsupportedEncodingException {\n    return String.format(\n        \"/monitor/msgVpns/%s/queues/%s\", urlEncode(messageVpn), urlEncode(queueName));\n  }\n\n  private static String createQueueEndpoint(String messageVpn) throws UnsupportedEncodingException {\n    return String.format(\"/config/msgVpns/%s/queues\", urlEncode(messageVpn));\n  }\n\n  private static String subscriptionEndpoint(String messageVpn, String queueName)\n      throws UnsupportedEncodingException {\n    return String.format(","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/broker/SempBasicAuthClientExecutor.java#L75-L111","documentation":"SolaceIO throws this IOException in SempBasicAuthClientExecutor.isQueueNonExclusive when the SEMP (Solace Element Management Protocol) HTTP response for the queue returns null content. The connector queries the broker's management API to learn the queue's access type; an empty response means the queue metadata could not be retrieved, so the queue-ownership check cannot proceed.","triggerScenarios":"Calling `isQueueNonExclusive(queueName)` when `getQueueResponse(queueName)` returns a BrokerResponse whose `content` is null — e.g. the SEMP endpoint returned no body (wrong SEMP URL/version, HTTP error swallowed, auth rejected so no JSON payload).","commonSituations":"Incorrect SEMP base URL or management port; SEMP API v2 not enabled on the broker; basic-auth credentials lacking management permissions; queue name doesn't exist so the response body is empty; network proxy stripping the response body.","solutions":["Verify the queue name exists on the message VPN via the broker CLI/UI or a direct SEMP call.","Check SEMP connection settings: correct management host/port, SEMP API v2 endpoint, and message VPN name.","Ensure the basic-auth user has SEMP/administrative read permissions for queue access-type queries.","Capture the raw HTTP response (curl the SEMP endpoint) to see why the body is empty."],"exampleFix":"// before\nboolean nonExclusive = sempClient.isQueueNonExclusive(\"myQueue\");\n// after (pre-validate via SEMP)\nBrokerResponse resp = sempClient.getQueueResponse(\"myQueue\");\nif (resp == null || resp.content == null) {\n  throw new IOException(\"SEMP returned no body for queue myQueue — check SEMP URL/permissions\");\n}\nboolean nonExclusive = sempClient.isQueueNonExclusive(\"myQueue\");","handlingStrategy":"try-catch","validationCode":"BrokerResponse r = sempClient.getQueueResponse(queueName);\nif (r == null || r.content == null) { /* fix SEMP config before proceeding */ }","typeGuard":null,"tryCatchPattern":"try { return sempClient.isQueueNonExclusive(queueName); } catch (IOException e) { if (e.getMessage().contains(\"SEMP is empty\")) { /* check SEMP URL/permissions */ } throw e; }","preventionTips":["Verify queue exists in the VPN before querying SEMP","Grant the SEMP user management read permissions","Test the SEMP endpoint with curl during setup"],"tags":["solace","java","semp","http","empty-response"],"backgroundTag":"empty-api-response","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}