Activemq can i set a propertie to a queue - properties

I have a question : In activeMQ, can I set a propertie to a queue ?
I know that I can set properties to a message, but is it possible also for a queue ?
For my use case, I would store a "last synchronisation date" into that queue that I could use each time I look for newest data in a database table. If the "update_at" column of my table is newer than the "last synchronisation date" of the queue, I send a message to the queue and update that "last synchronisation date" of the queue.
Thanks in advance.

Short answer: No.
The Queues themselves have no properties. ActiveMQ does have support for several different destination filters and policy objects to control the behaviour of destination under a variety of circumstances and you can install your own broker plugins that you can use to extend the functionality but there is no properties model for the Queues themselves.

Related

What happens when a shovel is deleted

We have a queue which takes incoming data and pushes the data into another queue in another machine through a shovel.
For some reason, we found that the source queue had backed up with around 2M messages. We couldn't figure out the cause for that as it seemed that the destination queue and the consumer of that queue was working fine.
We also realized that the shovel was setup with the default pre-fetch count of 1000.
We are not able to modify the shovel to set a higher pre-fetch count, the only option is to delete the shovel and setup a new one with higher pre-fetch count.
What will happen if we delete the shovel ?
Will it delete the messages in the queues ?
Thanks
Based on your latest comment, if I understand correctly, you have:
RabbitMQ1 - exchange RMQ1EXCA -> queueA1
RabbitMQ2 - exchange RMQ2EXCB -> queueB1
A shovel has been configured, exchange [RMQ1EXCA] to exchange [RMQ2EXCB]
And you found out that the queueA1 is filled up with millions of message.
If indeed this is an accurate depiction of your setup:
it's quite normal, as queueA1 is not part of the shovel process
if you check the queues bound to RMQ1EXCA, you should see one queue with a name starting with amq.gen-......
deleting the shovel will not impact the queueA1, as it's not related to the process (but will delete the queue amq.gen-...... that is)
If the description provided doesn't match your setup, please provide additional information to clarify your situation so that I can adapt my answer accordingly

Routing Dead-Lettered Messages

Is there a way in EasyNetQ to set the routing key [x-dead-letter-routing-key] argument when creating a Queue? (as far as I can see you can only set a DeadLetterExchange.)
IQueue updateCacheQueue = advancedBus.QueueDeclare(name: "UpdateCache", deadLetterExchange: "UpdatesDeadLetter");
RabbitMQ assumes that exchanges are superior to queues. You can create an exchange that delivers to exactly one queue, and thus your DLQ addressing issue is solved. Should you decide you need to take additional actions in the future (e.g. store the message for potential reprocessing AND ALSO alert operations via email), you can do that in the exchange without mucking up the queue processor.
I Added another parameter to the QueueDeclare method and created a pull request, and you can set it after version 0.40.6.355

How to find owner of queue in rabbitmq?

If I see some queue in rabbitmq (f.e. foobar), where is no activity, how I can find who created that queue, or, at least, which channel?
You can't find out creator except it was declared as exclusive and thus it has only one consumer.
Alternatively, you can find all channels (and thus connections) which utilize specific queue with management plugin.

How to set a redelivery policy in RabbitMQ/AMQP

I'm currently using ActiveMQ for my queueing system, and I'm wanting to make the transition to RabbitMQ. One feature I've been using that belongs to ActiveMQ is a redelivery policy, as sometimes our consumer rejects a message because it cannot handle it at this time, but may want to try again later, so it requeues it.
Right now in AMQP, when I reject a message, it's instantly pulled off the queue again immediately and tried again.
Is there a way, in RabbitMQ, to specify a redelivery policy for a queue, consumer, or message?
I also had problems with that behaviour. According to documentation (as far as I remember, maybe in newer version something changed) after requeue it is not stated where a message will be placed (it was described as undetermined). In my testcases (with version 2.8.2) some of messages were put to the end of a queue and one message (precisely first from clients prefetch) land on beggining (and being consumed immediately). In our application this caused livelock.
You could walkaround this by publishing copy of message to a queue and acking already delivered one in one transaction (but I recommend to carefully read section about transactions in docs) or use deadlettering to deal with temporaly unprocessable messages.

only latest message to be present in active mq?

I am sending messages to an Active MQ queue through Mule.
I want that, that only the latest message remains in the queue and not any previous one.
How can this be achieved?
Thank you very much.
set the queue size to be 1, the default eviction policy, which is oldestMessageEvictionStrategy, should kick out the previous message and put in the newest one. You can also set other policies for priorities, such as OldestMessageWithLowestPriorityEvictionStrategy or mess around with the TTL settings on your messages.
You may also get some warnings about full queue though, so be prepared to handle that.