Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

JMS subscribtion only

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Is there a way to consume (not sending) from JMS topic only?
Hello,

I have use case in my testing where I wish to subscribe to the JMS topic and consume messages.
From the options avaliable I can find only possibility to send request with JMSReplayTo header and consume from the choosen topic.

Is there a way to consume only messages and not sending them in the test case? I can not disable sending JMS message while I wish to receive only.

Thanks,
Piotr Madry
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hello,
    I suggest checking out Call Back Tool. You can configure Call Back tool to use JMS and listen for messages on particular queue/topic without need of sending messages. For more information, check out SOAtest User's Guide -> Reference -> Available Tools -> Messaging Tools -> Call Back.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Thanks, I can consume now from the topic.
    But, I have additional questions to the Call Back Tool:

    1) I couldn't find option for collecting/asserting headers in coming messages
    2) Is there a way to set counter for incoming messages in Call Back Tool? I wish to receive 3 in row not only 1. I can't add new Call Back Tool because all steps are running concurrently so it will consume the same message at the one time. I can't run steps sequentially because I can consume messages only at the point when subscriber is sending messages to the topic.

    Thanks in advance for a response!

    Regards,
    Piotr Madry
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hello,

    1) You can attach XML tools to Incoming Request of Call Back tool. To do this, left click on Call Back tool, and select "Add Output.." from drop down menu. You can add XML Assertor to enforce correctness of data in the message.

    2) You can configure test suites to send JMS message three times and then run Call back tool to retrieve 3 messages from queue. It depends on how you set up your test suite to iterate over data source. For example, you can have a data source which has three rows that iterates over SOAP/Messaging client to send three messages to JMS, and then run Call back tool to get these messages. You can also use Correlation ID to correlate incoming messages. This is listed under Incoming Message Correlation of JMS.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Hi,

    Thanks for response Zohrabb. I solved point no 2, but still I dont have solution for accessing JMS headers.
    XML Assertor can be used only to assert body content. I wish to have possibility to assert JMS headers in Call Back tool i.e. JMSDestination eq to queue_1 ertc.
    Do you know how to do it?
    I tried Extension Tool but I don't know how to get into JMS headers from that level.

    Regards,
    Piotr Madry
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited April 2010
    Hello,

    To assert JMS Headers:

    (1) add Extension tool to Call Back Tool and use following code snapshot

    CODE
    from java.lang import *
    from java.util import *

    def getHeader(input, context):
      jmsHeader = String(str(input.get("Request HTTP Headers")))
      context.put("Request HTTP Headers", jmsHeader)
      return jmsHeader

    (2) Run test to generate traffic

    (3a) Create Regression control (Left click on Call Back tool and select Create/Update Regression Control). Then, you can view the content of JMS header in Diff control.
    Diff control will automatically assert JMS headers. In any future run, if there was inconsistency between JMS header values in Diff control and current run, then SOAtest display changed lines of JMS headers.

    (3b) You can also add Header Data bank to Extension tool. By doing so, you will have freedom to validate individual JMS header and extract them for later use.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Thanks! That is working fine!
    Regards,
    Piotr Madry

Tagged