MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  New to MQ Rest API

    Posted 10/13/22 11:39 AM
    We have a new project where we have been asked to create a URL in MQ, postman application has to send some  API calls to MQ
    I have already pasted the basic registry xml file from /usr/mqm/web/mq/samp/configuration  to /var/mqm/web/installtions/Installtion1/server/mqweb
    and i have the changed the name to webuser.xml, but postman application is not able to put messages.
    output of dspmqweb:
    https://localhost:9443/ibmmq/console/" title="https://localhost:9443/ibmmq/console/" href="https://localhost:9443/ibmmq/console/" rel="noopener noreferrer" target="_blank" tabindex="-1">https://localhost:9443/ibmmq/console/
      https://localhost:9443/ibmmq/rest/" title="https://localhost:9443/ibmmq/rest/" href="https://localhost:9443/ibmmq/rest/" rel="noopener noreferrer" target="_blank" tabindex="-1">https://localhost:9443/ibmmq/rest/

    I want to create a new url with port 1414 can someone tell me how create that.

    ------------------------------
    Kunal Chadha
    ------------------------------


  • 2.  RE: New to MQ Rest API

    Posted 10/13/22 10:56 PM

    I would advise against running your MQ web server listening to port 1414. That is a port usually used for MQ channels to connect to, not web connections. If you have an MQ listener already using port 1414 it would not be able to accept web requests on that port as well. The default port number that you are using for your https connection, port 9443 should work fine.

    What kind of error is your application getting when it tries to put messages via the REST API? What URL are you using to do the put of messages from your application.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 3.  RE: New to MQ Rest API

    Posted 10/14/22 04:41 AM

    At 9443 port from application side they are getting connection refused

    can you please let me know how to create a new URL with port 1416 or 9443

    From my vdi i have to make connections to MQ server having MQ rest API



    ------------------------------
    Kunal Chadha
    ------------------------------



  • 4.  RE: New to MQ Rest API

    Posted 10/14/22 07:20 AM

    Please show the full error that is seen.

    To change the port, please follow the instructions here. Remember though you CANNOT make the port the same number that is used by the queue manager's TCP/IP listener. Port 1416 sounds very much like a queue manager listener port and not an HTTP port.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 5.  RE: New to MQ Rest API

    Posted 10/17/22 03:59 AM
    Stop mqweb and follow below steps to change the port:

    Step1:

    Navigate to

    /var/mqm/web/installations/Installation1/servers/mqweb

    Step2:

    Edit mqwebuser.xml file

    Step3:

    Add below xml tag to change the port in <server> </server> tags:

    Example:
    <variable name="httpPort" value="9444"/>
    <variable name="ltpaExpiration" value="15"/>
    </server>

    Step4:

    start MQWEB

    ------------------------------
    RamamohanaRao Chilla
    ------------------------------



  • 6.  RE: New to MQ Rest API

    Posted 10/18/22 11:50 AM
    As @Morag Hughson mentioned, using 1414 port for REST API is not a good option.

    If u want to change the port; try using 443 ; this way the URL will not require a port entry on the address bar.

    ​​​

    ------------------------------
    om prakash
    ------------------------------



  • 7.  RE: New to MQ Rest API

    Posted 10/19/22 05:47 AM
    Edited by Francois Brandelik 10/19/22 05:53 AM
    You will have to use setmqweb properties
    endmqweb
    setmqweb properties -k httpHost -v hostname
    strmqweb
    dspmqweb
    ​

    I noted that your entry said localhost:9443/ibmmq/rest
    If your Postman instance is not running on the MQ server you're out of luck as it only accepts calls from the local host
    Try setting the hostname value to either the hostname or an ip (comes back with the hostname value)
    experiment with the hostname value and verify what happens at os level using netstat:

    endmqweb
    setmqweb properties -k httpHost -v 0.0.0.0
    strmqweb
    dspmqweb
    netstat -an | find "9443" (windows)
    netstat -an | grep 9443 (Unix/Linux)



    Hope this helps



    ------------------------------
    Francois Brandelik
    ------------------------------