I'm a little confused on these two options. Do they both do the same thing? Anyone able to clarify? First impressions are that dispatchAsync deals with broker-to-consumer and alwaysSessionAsync deals with session-to-consumer.
Also, regarding alwaysSessionAsync, the docs explanation seems non-inituitive:
"If you are using Consumers with auto acknowledge, you can increase throughput by passing messages straight through the Session to the Consumer by setting the alwaysSessionAsync property on the ActiveMQ ConnectionFactory to be true"
I would have thought that to have messages passed on straight through you would set alwaysSessionAsync to false. Looking at the code, that is what seems to be happening.
I have some connections that are in the same VM as the broker and some that aren't. What I have done is configure the connection factory as such
connectionFactory.setUseAsyncSend(true);
connectionFactory.setAlwaysSessionAsync(!inVM);
connectionFactory.setDispatchAsync(!inVM);
So if the connection is to a broker that is in the same VM, I make all dispatch synchronous. The consumer that is in the same VM is a very fast consumer, with its own SEDA queue. Have I interpreted this correctly?