That's easy - Queue semantics.  I recommend reading the JMS specification
with a focus on understanding how Queues and Topics operate.

With that said, let me clarify.  Queues guarantee once-and-only-once message
delivery (with some caveats related to ensuring clients actually processed
messages).  This means that each message on a queue will be delivered to
one, and only one, consumer.

ActiveMQ supports multiple Queue consumers by sending messages in
round-robing fashion.  Hence the receipt of every-other-message.

If you need multiple consumers to receive every message, Topics may be the
way to go as they are a broadcast.  However, they have downsides too - such
as clients without an active subscription not receiving messages (i.e.
subscribers, unless they are durable, need to always be connected when
messages are produced to the Topic, or they lose those messages).

Please keep in mind that ActiveMQ is not a message store, and using it as
such will lead to a lot of problems, including consumption of all the
brokers available resources (memory and disk).  It also gives poor, if any,
insight into the messages it holds (unlike a DB that allows for all types of
queries and random-access).

For a chat solution (if I read your intention correctly) - using ActiveMQ to
notify active clients of new messages is a great idea; and even including
the content of those messages is a good way to go.  Having a chat-message
history stored somewhere with longer-term persistence, such as a database,
is a good way to support pulling up history - if that's needed.

Do be careful with Topics and networks-of-brokers though.  There are a few
cases in which Topic guarantees are reduced in a network-of-brokers (e.g.
consumers on one broker missing messages produced on another broker because
the connection between the brokers dropped temporarily - and the bridges
between brokers intentionally drop when unexpected processing errors occur
even if those errors are normal given client operations requested).



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Wierd-skipping-of-messages-using-Websocket-activeMQ-tp4680230p4680261.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to