Service Virtualization

 View Only
  • 1.  Subscribe/Publish Topics simultaneously

    Posted Oct 14, 2016 12:05 PM

    Hi,

     

    In one of our requirements, we want to Subscribe & Publish Topics simultaneously. Please let us know the ways of doing it in CA LISA 7.5.

     

    We did the Parallel execution from Run Mode but it doesn't work.



  • 2.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 14, 2016 01:11 PM

    I don't understand what you mean.  Can you describe your scenario in more detail?



  • 3.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 17, 2016 04:40 AM

    Hi Kevin,

     

    Thanks for the reply. Here the scenario is. 

     

    We are publishing an XML message from a Queue. A Topic is supposed to pick it up & so on.

     

    It is only possible if we first Subscribe the Topic & then Publish it from the Queue, simultaneously (considering Topic being a Virtual space & all). How this scenario can be handled in CA LISA 7.5 version?

     

    If we first Subscribe the Topic, execute the test case & then Publish the Queue, it doesn't work. But it works from multiple VMs. Like we are Subscribing the Topic from one machine, execute the test case & before it gets finished, we Publish the Queue from another machine. It's able to pick the XML message.

     

    So we tried the Parallel execution from RunMode but it too didn't work.



  • 4.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 17, 2016 09:56 AM

    In short, We need to Publish on a Queue & simultaneously Subscribe to 2 different Topics. How this scenario can be handled?



  • 5.  Re: Subscribe/Publish Topics simultaneously
    Best Answer

    Posted Oct 17, 2016 01:27 PM

    So you want to start two listeners, one on each topic, without waiting for a message from each listener?  Then you want to send a message to a queue, and then afterwards receive messages from those topics? 

     

    You can do this in a single test case with the old 'JMS Messaging (JNDI)' step, but with the newer 'JMS Send Receive' step this kind of thing isn't supported until DevTest 8.0.

     

    You will need five steps in your test case:  Three 'JMS Message (JNDI)' steps followed by two 'Async Consumer' steps:

     

    The first two steps start the listeners on each of your topics.  They should have only the 'Subscriber Info' section enabled, 'Type' should be 'Topic - ASYNC', and 'Async Key' should be some string unique for this topic in this test case.  I simply used "TOPIC1" and "TOPIC2".

     

    The third step sends your request.  It should have only the 'Publisher Info' section enabled.

     

    The fourth and fifth steps receive a message on each of the topic listeners you started in steps 1 and 2.  For 'Async Queue' enter the 'Async Key' from the corresponding listener step (in my case, "TOPIC1" or "TOPIC2").

     

    It's possible to do a similar setup with the newer 'JMS Send Receive' step, but not until DevTest 8.0 when the 'Prepare Only' checkbox was added on the Receive side.



  • 6.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 18, 2016 10:36 AM

    Hi Kevin,

     

    Thanks much for helping. I replicated the same & it totally worked. Appreciate your help.

     

    As an alternative, we created Hold Queues for the Topics & that method worked too.



  • 7.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 21, 2016 12:15 PM

    Hi Kevin,

     

    With the approach you suggested, it worked.

     

    However now we found out that we are receiving extra copy of the messages.

     

    If I am sending 3 requests then for the 3rd request we are receiving the 2nd request's response again.

     

    We only receive the 3rd request's response if we provide a 4th request & so on.

     

    Please suggest.



  • 8.  Re: Subscribe/Publish Topics simultaneously

    Posted Oct 24, 2016 03:22 AM

    It's hard to guess what's going on here. Are you running your test case in a loop, or do you restart the test case for each request?  Do you need to be using a correlation scheme, possibly involving the Correlation ID JMS header?  Are you using durable topic subscriptions?