2

I am currently working on an assignment which requires me to benchmark response times between apache activemq and aws-sqs.

In my finding I found that, activemq producer takes 35 sec / 1000 messages [120 bytes each] consumer takes 250 ms / 1000 messages [120 bytes each]

I am using Maven + Git + Java based project structure. I am creating a session from connectionfactory in a following way:

cFactory.createSession(false, Session.AUTO_ACKNOWLEDGE);

Connection is synchronous, message reliability is important. Can someone tell me the logic or reason behind this behavior?

I suspect that producer takes time because it has to not only send but also wait for the acknowledgement from amq service running on ec2 about the fact that it has journaled the message.

Please let me know why the producer is slow and how can I improve upon it.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Dhruvenkumar Shah
  • 520
  • 2
  • 10
  • 26

1 Answers1

2

Your suspicion is correct 'it has to not only send but also wait for the acknowledgement from amq service running on ec2 about the fact that it has journaled the message.'

Try sending multiple messages in a transaction. Messages in a tx get sent without having to wait for the acknowledgement. Only when you do a commit() does the client block waiting for the acknowledgement that all operations in the tx have been stored successfully.

Hiram Chirino
  • 4,103
  • 1
  • 22
  • 21
  • @chirino we meet again, we exchanged messages over activemq channel, I will accept this answer to mark this question closed. Thanks again. – Dhruvenkumar Shah Aug 09 '13 at 16:28