Thanks guys! these were very helpful and quick responses.�<div><br></div><div>I will read the docs you recommended and come back in case of any further ideas or questions :)</div><div><br></div><div>Thanks a lot</div><div>
<br></div><div>Art<br><br><div class="gmail_quote">On 18 October 2012 22:05, Alexis Richardson <span dir="ltr">&lt;<a href="mailto:alexis@rabbitmq.com" target="_blank">alexis@rabbitmq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
See the long discussion on ordering posted in the depths of the thread here:<br>
<br>
<a href="http://www.quora.com/RabbitMQ/RabbitMQ-vs-Kafka-which-one-for-durable-messaging-with-good-query-features/" target="_blank">http://www.quora.com/RabbitMQ/RabbitMQ-vs-Kafka-which-one-for-durable-messaging-with-good-query-features/</a><br>

<br>
Note that Kafka has at most one consumer per &#39;partition&#39; which is<br>
equivalent to the property Tim described.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Thu, Oct 18, 2012 at 12:03 PM, Alexis Richardson &lt;<a href="mailto:alexis@rabbitmq.com">alexis@rabbitmq.com</a>&gt; wrote:<br>
&gt; If you use the consistent hashing exchange, then you can make sure<br>
&gt; that two messages with the same key are sent to the same queue. �Then,<br>
&gt; provided you do not allow parallel processing of those messages due to<br>
&gt; how they are consumed, you can &quot;process in order&quot; as required.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Oct 18, 2012 at 11:43 AM, Tim Watson &lt;<a href="mailto:tim@rabbitmq.com">tim@rabbitmq.com</a>&gt; wrote:<br>
&gt;&gt; Hi<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 10/18/2012 10:30 AM, Artur Ejsmont wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi there everyone,<br>
&gt;&gt;<br>
&gt;&gt; I am working on a rabbitmq based messaging system and i was wondering if you<br>
&gt;&gt; could help me out :)<br>
&gt;&gt;<br>
&gt;&gt; I was wondering how could i enforce events being processed in the order they<br>
&gt;&gt; are published?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; So from <a href="http://www.rabbitmq.com/semantics.html" target="_blank">http://www.rabbitmq.com/semantics.html</a>, we can see:<br>
&gt;&gt;<br>
&gt;&gt; &quot;Section 4.7 of the AMQP 0-9-1 core specification explains the conditions<br>
&gt;&gt; under which ordering is guaranteed: messages published in one channel,<br>
&gt;&gt; passing through one exchange and one queue and one outgoing channel will be<br>
&gt;&gt; received in the same order that they were sent. RabbitMQ offers stronger<br>
&gt;&gt; guarantees since release 2.7.0.<br>
&gt;&gt;<br>
&gt;&gt; Messages can be returned to the queue using AMQP methods that feature a<br>
&gt;&gt; requeue parameter (basic.recover, basic.reject and basic.nack), or due to a<br>
&gt;&gt; channel closing while holding unacknowledged messages. Any of these<br>
&gt;&gt; scenarios caused messages to be requeued at the back of the queue for<br>
&gt;&gt; RabbitMQ releases earlier than 2.7.0. From RabbitMQ release 2.7.0, messages<br>
&gt;&gt; are always held in the queue in publication order, even in the presence of<br>
&gt;&gt; requeueing or channel closure.<br>
&gt;&gt;<br>
&gt;&gt; With release 2.7.0 and later it is still possible for individual consumers<br>
&gt;&gt; to observe messages out of order if the queue has multiple subscribers. This<br>
&gt;&gt; is due to the actions of other subscribers who may requeue messages. From<br>
&gt;&gt; the perspective of the queue the messages are always held in the publication<br>
&gt;&gt; order.&quot;<br>
&gt;&gt;<br>
&gt;&gt; So you&#39;ve got to think about it in those terms. It&#39;s exactly the same with<br>
&gt;&gt; ActiveMQ message groups, because they are based on the Exclusive Consumer<br>
&gt;&gt; feature, which states: &quot;The broker will pick a single MessageConsumer to get<br>
&gt;&gt; all the messages for a queue to ensure ordering. If that consumer fails, the<br>
&gt;&gt; broker will auto failover and choose another consumer.&quot;<br>
&gt;&gt; (<a href="http://activemq.apache.org/exclusive-consumer.html" target="_blank">http://activemq.apache.org/exclusive-consumer.html</a>) except that groups are<br>
&gt;&gt; parallel, so: &quot;... logically Message Groups are kinda like a parallel<br>
&gt;&gt; Exclusive Consumer. Rather than all messages going to a single consumer, the<br>
&gt;&gt; standard JMS header JMSXGroupID is used to define which message group the<br>
&gt;&gt; message belongs to. The Message Group feature then ensures that all messages<br>
&gt;&gt; for the same message group will be sent to the same JMS consumer - while<br>
&gt;&gt; that consumer stays alive. As soon as the consumer dies another will be<br>
&gt;&gt; chosen.&quot; (<a href="http://activemq.apache.org/message-groups.html" target="_blank">http://activemq.apache.org/message-groups.html</a>).<br>
&gt;&gt;<br>
&gt;&gt; You might be able kludge something similar using the consistent hash<br>
&gt;&gt; exchange plugin<br>
&gt;&gt; (<a href="http://hg.rabbitmq.com/rabbitmq-consistent-hash-exchange/file/rabbitmq_v2_8_7/README.md" target="_blank">http://hg.rabbitmq.com/rabbitmq-consistent-hash-exchange/file/rabbitmq_v2_8_7/README.md</a>)<br>

&gt;&gt; but you will *not* get the same kind of guarantees.<br>
&gt;&gt;<br>
&gt;&gt; We have been asked about this feature before and will probably implement<br>
&gt;&gt; something like it in a future release.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Tim<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rabbitmq-discuss mailing list<br>
&gt;&gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt;&gt; <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Visit me at:<br><a href="http://artur.ejsmont.org/blog/" target="_blank">http://artur.ejsmont.org/blog/</a><br><br>
</div>