Is ActiveMQQueue really a Queue?

2009-09-26 Thread itamara

hi ActiveMQ users

I'm new to ActiveMQ (bet you never heard that before :-)).

I'm using org.apache.activemq.command.ActiveMQQueue as my destination.
For debugging purposes I log the events of sending the message and the
events of MessageListener.onMessage. I find that...

The ActiveMQQueue does not seem to act as a queue - in the "first in, first
out" sense.

Is that so?

Is it configurable?

Why do I care? Because it looks as some messages can wait in the queue
forever, can be forgotten there. And though it's not exactly my case, some
might want a pure FIFO queue implementation.

thanks for any help and clarification.
-- 
View this message in context: 
http://www.nabble.com/Is-ActiveMQQueue-really-a-Queue--tp25625177p25625177.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Maintaining Message Uniqueness in a Queue

2009-09-29 Thread itamara

hi AMQ users

What is the best way to ensure Message Uniqueness in a Queue?

I'm having the following architecture:

A single Scheduler (a quartz scheduled job) is periodically checking a DB
for entities to update, for each entity-to-update it uses a single Sender to
send an Update Message with a property holding the entity ID.

The Sender references an ActiveMQQueue destination and a Spring's
JmsTemplate over a PooledConnectionFactory.

The Consumers - MessageListeners in a Spring's
DefaultMessageListenerContainer container - receive a message and do their
onMessage, which may involves updating the DB.


I wish to avoid more then one Consumer updating the same entity
simultaneously, as it will result in DB errors.

I thought the Scheduler should account for this synchronization, so upon
resolution of the entities to update, it tags them in order to know not to
update them again - a tag that is removed when update is finished. But as
errors may occur, this tag is taken in account only for a certain period of
time. This makes the situation, in which the queue contains two messages
with the same entity ID, possible.

Which may cause exactly what I'm trying to avoid.

How do I pull it off?

I thought knowing which messages are currently in the queue could help the
Scheduler decide.

What about the message ID? Can it help here?

I could also expire the message, but it is not accurate. I might throw away
messages for no good reason.

Maybe it is better to do this synchronization elsewhere?

Thanks a lot for any help or thoughts.
-- 
View this message in context: 
http://www.nabble.com/Maintaining-Message-Uniqueness-in-a-Queue-tp25660461p25660461.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Is ActiveMQQueue really a strict FIFO queue?

2009-09-29 Thread itamara

The first step of solving a problem is asking the right question.

(or is it acknowledging it, and the right question is only the second?
:confused:)

I was looking for something else. Thanks a lot for all the repliers. Your
help did not go unappreciated.

Please bare with me to the following thread: 
http://www.nabble.com/Maintaining-Message-Uniqueness-in-a-Queue-td25660461.html
Maintaining Message Uniqueness in a Queue .

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Is-ActiveMQQueue-really-a-Queue--tp25625177p25660661.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Maintaining Message Uniqueness in a Queue

2009-09-29 Thread itamara

As the documentation declares: "Message Groups rock!"

It looks like the right thing for me, though I still have to wait for
version 5.3.
I can do that.

Thanks a lot!
-- 
View this message in context: 
http://www.nabble.com/Maintaining-Message-Uniqueness-in-a-Queue-tp25660461p25665844.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Making sure a message was consumed (client acknowledge, time to live)

2010-10-10 Thread itamara

hi all,

I'm looking for a way to verify that a message was consumed, in a given
time(!), and to react to a situation when the message was not consumed in
that time.

I'm setting the destination with CLIENT_ACKNOWLEDGE, and the message with my
TimeToLive value.

What I need is some listener on the session's event of expiring a message,
resulted from a TimeToLive timeout.
I did not find any documentation for such a thing. As far as I know, when
TimeToLive is reached, the session just kill and drop the message.

Does anyone know something else? listening to a message's timeout?

10x
Itamara
-- 
View this message in context: 
http://activemq.2283324.n4.nabble.com/Making-sure-a-message-was-consumed-client-acknowledge-time-to-live-tp2970107p2970107.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.