#!/bin/bash

CLI_PATH="/opt/clients/"
BROKER="localhost"

ADDRESS='JAMQNodeeeeTests_test_multiple_anycast_queues_one_address'
QUEUE='queue_0'

CLIENTS="cli-artemis-jms-1.2.2-SNAPSHOT-2.0.0.amq-700013-redhat-1.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.4.0.amq-710001-redhat-1.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.4.0.amq-710004-redhat-1.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.1.amq-720004-redhat-1.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00001.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00004.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00015.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00017.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00019.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.6.3.redhat-00020.jar
cli-artemis-jms-1.2.2-SNAPSHOT-2.7.0.redhat-00054.jar
cli-artemis-jms-1.2.2-SNAPSHOT.jar"

for client in $CLIENTS
do
    set -x
    #java -jar "${CLI_PATH}${client}" sender --help
    java -jar "${CLI_PATH}${client}" sender --timeout 120 --log-msgs dict --broker "tcp://${BROKER}:61616" --conn-username admin --conn-password admin --address "$ADDRESS::$QUEUE" --count 3
    java -jar "${CLI_PATH}${client}" receiver --timeout 120 --log-msgs dict --broker "tcp://${BROKER}:61616" --conn-username admin --conn-password admin --address "$ADDRESS::$QUEUE" --count 3
    set +x
done

