rabbitmq-tutorials/soapui
Jonathan Leitschuh 7bfa1f4d05 Use HTTPS instead of HTTP to resolve dependencies
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2020-02-11 09:59:47 -05:00
..
.mvn/wrapper URL Cleanup 2019-03-21 03:27:15 -05:00
mvnw URL Cleanup 2019-03-11 21:56:13 -05:00
mvnw.cmd URL Cleanup 2019-03-11 21:56:13 -05:00
pom.xml Use HTTPS instead of HTTP to resolve dependencies 2020-02-11 09:59:47 -05:00
RabbitMQ-tutorials-soapui-project.xml URL Cleanup 2019-03-19 20:11:49 -05:00
README.md URL Cleanup 2019-03-20 03:25:16 -05:00

RabbitMQ tutorials ported to SoapUI

The code is based on the Java tutorials, with slight modifications to make it work in SoapUI.

Prerequisites

  • SoapUI or ReadyAPI with the Java Client JAR file in the bin/ext directory.
  • local RabbitMQ broker instance running with all the defaults

Running

You can import and run the RabbitMQ-tutorials-soapui-project.xml in the GUI. The project does not have any asserts; all log messages can be viewed in the "script log" tab.

You can also use the CLI runner: $SOAPUI_HOME/bin/testrunner.sh RabbitMQ-tutorials-soapui-project.xml.

Or you can use the provided Maven pom: ./mvnw verify.

Tutorials

The code to send messages to RabbitMQ is pretty much unchanged from the Java tutorials. The biggest change is: there is no reading of the text of the message from the command line - the text of the message is included in each individual step.

There are two changes to the code to consume messages:

  1. The program pauses for a bit to let the message get processed. Without this, SoapUI ends the script step immediately and kills the asynchronous process running in the background waiting for the message. The exact pause will depend on the specific case; it can be as simple as sleep 10000, or little more elaborate, e.g.:

    int stop = 0
    while(message == null && stop++ < 20) {
    	log.info " [*] Waiting for messages."
    	sleep 500
    }
    
  2. At the end of each read script step, the channel and connections are closed explicitly:

    channel.close()
    connection.close()
    

Without this, some background threads are still running and would make the test hang.