Layer7 API Management

 View Only
  • 1.  API Gateway - ActiveMQ integration (HTTP -> JMS)

    Posted Jan 23, 2020 10:36 AM

    Hi,

    I am running API Gateway 9.4 + ActiveMQ 5.14.3 and I am trying to create an integration:

    1. Send JSON with Postman:
    { "message":"This is a test" }

    2. Gateway uses JMS Assertion to send JMS message;

    3. ActiveMQ receives a message in a queue.

    I was able to register a JMS destination using AMQP 1.0 Broker:


    I wrote a simple API to get this message and route to JMS:


    In Route via JMS assertion I just selected my JMS Destination (that null is odd btw):


    And I have no idea how to link my message variable to JMS and I couldn't find any documentation.  =(

    This is my Postman return:



    This is my Gateway log:



    Can you help me please ?

    Thanks.

    ------------------------------
    Solution Architect
    SEC4YOU
    ------------------------------


  • 2.  RE: API Gateway - ActiveMQ integration (HTTP -> JMS)

    Posted Jan 29, 2020 03:47 AM
    Edited by Deactivated User Jan 29, 2020 04:09 AM

    Are you expecting a response? if not you can select No replies (one way).. I did submit it to the ActiveMQ.

    I am just playing around with other option will update soon



    ------------------------------
    Pre-Sales Consultant
    CA Southern Africa
    ------------------------------



  • 3.  RE: API Gateway - ActiveMQ integration (HTTP -> JMS)

    Posted Jan 29, 2020 09:25 AM
    Hi Ronald,

    Yes,  I am expecting a response to get at least JMSMessageID from the delivered message, but also I would like to send the value "This is a test" from Postman request to my ActiveMQ.

    In fact, in addition to the error, something was delivered to it, but it was not a Text Message.

    This is my JMS Destination Properties - Outbound Options :

    This is what I got in my ActiveMQ:


    This is my API Gateway log:



    Thank you for any help =)

    ------------------------------
    Solution Architect
    SEC4YOU
    ------------------------------



  • 4.  RE: API Gateway - ActiveMQ integration (HTTP -> JMS)

    Posted Jan 30, 2020 08:25 AM
    Edited by Deactivated User Jan 30, 2020 09:26 AM
    Hi Fernando,

    I played around the option a got the setup working. So basically we need to ensure the combination is right

    Here are to option I tried to get it working
    ​And Set the value for 

    Output:


    JMS ID: ${JMSMessageID}
    Response Message ID: ${response.jms.allheadervalues}
    Response Mainpart: ${response.mainpart}

    This put the data in the jms queue




    Not sure why it DeQueues the Messages from  the queue.. Will play more around other options. 

    If this is urgent I would recommend raising a support ticket with the exact requirement.. As it more of the setting on the Active MQ that need to receive it



    ------------------------------
    Pre-Sales Consultant
    CA Southern Africa
    ------------------------------



  • 5.  RE: API Gateway - ActiveMQ integration (HTTP -> JMS)

    Posted Jan 30, 2020 05:18 PM
    Thank you Ronald.

    It is really weird that all messages are dequeued, I got the same result here.

    I will try to change a few things.


    ------------------------------
    Solution Architect
    SEC4YOU
    ------------------------------



  • 6.  RE: API Gateway - ActiveMQ integration (HTTP -> JMS)
    Best Answer

    Posted Jan 31, 2020 03:50 PM
    Hi Ronald, 

    Finally, I managed to make it work.

    Basically it is the same thing as my first post, but I changed to No replies (one way) in JMS Destination.

    To get the message properly from ActiveMQ I did a small change in this sample https://github.com/apache/qpid-jms/tree/master/qpid-jms-examples on Receiver.java class to accept ByteMessage.

    ------------------------------
    Solution Architect
    SEC4YOU
    ------------------------------