Forum Discussion

Said's avatar
Said
Contributor
7 years ago

Advice on how to read multiple messages from queue

Hi,

I have the following situation:

  • A XML message is put on a sourceQueue. There is a repeating group in this XML message
  • An adapter process this message and puts multiple XML messages on a targetQueue. For each repeating node in the sourceQueue a XML message is put on the targetQueue, after doing some transformations.

What do I want to test with SoapUI Pro:

  1. Check if all repeating groups items are correctly processed
  2. Total nr of messages in targetQueue should match
  3. The transformations should be correct.

What is the best approach for this with SoapUI Pro? I can loopt through the targetQueue with a groovy script. Are there other options?

 

Additional question: when I am monitoring the tartgetQueue (with groovy script) and other software (adapter) is also monitoring/reading the queue. How do I make sure that I get the message? Cause when the other software get's it before me, I will NOT get it. Do I just stop that piece of software in order to do my test? Other options?

 

Thanks in advance!

  • Said's avatar
    Said
    7 years ago

    Hi richie

    Thanks for your answer. I have managed to create a script for this. I have used the code on this page. I used XmlSluper() to combine the messages on the queue to 1 big xml. Then I did all my checks (comparing source and target). When I need to test I request the developers to stop the adapter, so that I can pick up the messages. We might create a separate queue in the future for testing purpose.

     

  • richie's avatar
    richie
    Community Hero
    Hey Said,

    I can probably help to answer this, but i'm struggling to think cos i have manflu at moment.

    First thing i need to ask. How are the messages transformed? Are you using an ESB to do the transformations? Second, is the message exchange pattern asynch or synch messaging? If asynch, then youll need your developers to generate an api for you to use to test your stuff as you wont get a response. Even with synch messaging (which does generate a response) it might not give you what you need to test it, so additional apis enabling you to test might still be required.

    Waiting on your response,

    Cheers,

    richie
    • Said's avatar
      Said
      Contributor

      Hi richie

      Thanks for your answer. I have managed to create a script for this. I have used the code on this page. I used XmlSluper() to combine the messages on the queue to 1 big xml. Then I did all my checks (comparing source and target). When I need to test I request the developers to stop the adapter, so that I can pick up the messages. We might create a separate queue in the future for testing purpose.