🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

Solace Container returns 200 but no content on SEMPv2

rothek
rothek Member Posts: 7

Hi

I have a Solace Container running in Docker (via docker compose) with the following setup:

solace-local:
  image: solace/solace-pubsub-standard:9.12.1.17
  restart: always
  shm_size: 1gb
  ulimits:
    core: 1
    nofile:
      soft: 2448
      hard: 6592
  deploy:
    restart_policy:
      condition: on-failure
      max_attempts: 1
  environment:
    - username_admin_globalaccesslevel=admin
    - username_admin_password=admin
    - system_scaling_maxconnectioncount=100
  ports:
    - "58080:8080" # Solace PubSub+ Broker Manager
    - "59000:9000" # REST / SEMP
    - "58000:8000" # MQTT over TCP
    - "51883:1883" # MQTT over WebSocket
    - "55672:5672" # AMQP
    - "58008:8008" # JavaScript sample applications
    - "55550:55555" # SMF for Windows & Linux 
  networks:    
    - solace-config-network



this is a container meant for local development/testing. The developers should not have to configure users, queues, ... on their own, so i want to have a file that a dev only has execute once and their solace container is up an ready. My general idea is to create a second container that sends a set of curl requests to solace, both are of course in the same docker network. This is the command the configuration container needs to execute:

solace-config:  
  image: alpine/curl  
  networks:    
    - solace-config-network  
  depends_on:    
    - solace-local  
  command: >    
    sh -c "    
    VPN_DATA='{"msgVpnName": "myVpn"}';    
    USER_DATA='{"clientUsername": "default", "password": "default"}';    
    QUEUE_DATA='{"queueName": "myQueue"}';
    curl -i -X POST 'solace-local:9000/SEMP/v2/config/msgVpns' -u admin:admin -d "'%VPN_DATA'";
    curl -i -X POST 'solace-local:9000/SEMP/v2/config/msgVpns/myVpn/clientUsernames' -u admin:admin -d "'%USER_DATA'";
    curl -i -X POST 'solace-local:9000/SEMP/v2/config/msgVpns/myVpn/queues' -u admin:admin -d "'%QUEUE_DATA'";
    echo Solace configured.
    "


the configuration container is in the 'solace-config-network' (which is defined inthe same docker compose file as well) and everything seems to be fine since every post request returns 200 OK, but when checking the solace gui nothing is created. no vpn, nothing else. I also tried sending these requests via Postman - same response, 200 OK but no body and nothing is created. For the postman request i replace the hostname with localhost and the port with the mapped port. Interestlingly though, when trying to GET http://localhost:59000/SEMP/v2/config/msgVpns/default via Postman, i receive a 405 Method Not Allowed with the following response body:

<solace-error-response>
    <code>405</code>
    <reason>
        <![CDATA[Method Not Allowed]]>
    </reason>
    <detail>
        <![CDATA[
Method not allowed
]]>
    </detail>
    <internal-use>1:1583</internal-use>
</solace-error-response>


event.log and debug.log from the solace/jail are appended below

what am I missing here? It really bugs me that the requests to create a ressource return a 200 without body, but a GET with a 405 and a body that says "Method Not Allowed". Any help to configure the container is appreciated.





Comments

  • uherbst
    uherbst Member, Employee Posts: 130 Solace Employee

    Hi @rothek,

    there is a misunderstanding in ports

    A Solace broker has 2 different services speaking HTTP somehow:

    Service A: SEMP, SEMPv2, Web UI/Broker manager

    Service B: publishing messages via REST


    Service A in your example is Port 8080... you should direct your curl to 8080, not 9000.


    Uli

  • rothek
    rothek Member Posts: 7


    Thank you so very much, this solved my problem!