fmtn/a

Move/Copy Queues Inverted

tom-ohare opened this issue · 4 comments

Hi,

Great project!

However, move and copy didn't work as I expected and I think the problem is just a typo (repeated). Both the executeMove and executeCopy method of A.java begin with the 2 statements:

    Queue tq = tsess.createQueue(cmdLine.getArgs()[0]);
    Queue q =  tsess.createQueue(cmdLine.getOptionValue(CMD_MOVE_QUEUE)); // Source

But I think q and tq should be swapped:

    Queue q = tsess.createQueue(cmdLine.getArgs()[0]); // Source
    Queue tq =  tsess.createQueue(cmdLine.getOptionValue(CMD_MOVE_QUEUE)); // Target

Do you agree?

Okay, the syntax is supposed to be a -C source.queue target.queue

This is actually the way it works and the way it's documented. However, the output message is not correct. Look at the following example:

petter in ~/git/a on master●● λ a -p "" source
Message sent
Operation completed in 18ms (excluding connect)

petter in ~/git/a on master●● λ a -M source target
1 msgs moved from target to source
Operation completed in 127ms (excluding connect)

I have fixed the output message, so that it shows correct info.

Thanks for pointing that one out!

Hi,

Sorry to come back on this but I'm not seeing the same results as you. Following your example above, and using the latest version:

a554998@BEBRPCDP2048 ~/SW $ ./A.sh -b tcp://btwls0007ap:63630 -p "" source
Message sent
Operation completed in 40ms (excluding connect)
a554998@BEBRPCDP2048 ~/SW $ ./A.sh -b tcp://btwls0007ap:63630 -M source target
0 msgs moved from source to target
Operation completed in 146ms (excluding connect)
a554998@BEBRPCDP2048 ~/SW $ ./A.sh -b tcp://btwls0007ap:63630 source -M target
1 msgs moved from target to source
Operation completed in 159ms (excluding connect)

The second invocation does actually move the message from source to target despite the misleading output at the end.

The A.sh is just a little script:
a554998@BEBRPCDP2048 ~/SW $ cat A.sh
#!/bin/sh
java -jar /home/a554998/SW/a/target/a-1.0.3-SNAPSHOT-jar-with-dependencies.jar "$@"

Am I missing something?

Sorry, please ignore the above comment.

Something strange in my git setup - I was sure I'd pulled the latest version but .... it seems not.

If I lie low from now on you can assume I'm happy.

Once again, sorry for the noise.

Haha! No problem. I'm pretty sure I pushed that fix (279317d).

I'm glad you seem to find the code useful.