How can I monitor queue buffer of ovs or Physical switches? - switch-statement

I have set two queues in a port .I want to know how many packets are waiting in the queues .now I can only get the tx_packets of a queue ,can I get rx_packets of a queue? or,do you have a way to get the space has been used in a queue?

Related

How can I get unacked messages count of a RabbitMQ queue using NodeJs (amqplib)

How can I get unacked messages count of a RabbitMQ queue using NodeJs (amqplib).
we can easily get the total message count of a queue using checkQueue or assertQueue method.
I have many dynamic queues and those queues are consumed by multiple consumers, I want to delete the queue after the process of all jobs.
The problem is when a consumer attached to a queue then I am checking the message count is zero or not, if the message count is zero then I deletes the queue, but at that time if that queue has some unacked messages but the message count is zero then how can I handle that.
In this case you can set auto-delete flag to queue on create and check queue size on consume.
When queue size will be 0 you just stop consume process for this consumer and close channel for this consumer. When all consumers close their channels queue will be auto-deleted by RabbitMQ.

Azure service bus - Topic full

I have a process(Process A) that keeps sending events to an ASB topic. There are multiple consumers of the topic and therefore multiple subscriptions. So lets say that one of the consumer's process is down. And due to this the topic gets full as the messages are not consumed. Does this mean then Process A also fails as it is not able to send messages to ASB topic as its full?
Two more things to check:
Make sure that your dead letter queue is not full that counts towards the size of the entity.
Make sure that you have at least one subscription that works for each message. For example, if you send a message with ID=1, but you only have a subscription with ID=2, the messages will get backed up.
I think you are correct, once the limit is reached the queue stops.
However, with partitioning (using all 16 partitions * 5 GB), you can store up to 80 GB:
https://azure.microsoft.com/en-us/blog/partitioned-service-bus-queues-and-topics/
Another solution is to use auto forwarding, so the topic forwards all messages to another queue/topic
https://azure.microsoft.com/en-us/documentation/articles/service-bus-auto-forwarding/
This way each subscriber can have it's own queue of 5GB (or 80GB if you use partition)
Some more info:
https://azure.microsoft.com/nl-nl/documentation/articles/service-bus-azure-and-service-bus-queues-compared-contrasted/
https://azure.microsoft.com/en-us/documentation/articles/service-bus-quotas/

Spring-integration / ActiveMQ subscribe to multiple destinations in a single thread

I am using multiple <si:service-activator>'s and <jms:message-driven-channel-adapter>'s to subscribe to multiple queues and topics. Messages from each destination are received in a separate thread, which means that my receiving code is full of locks to guard the mutable internal state.
I would like my receiving code to be lock free. Is it possible to configure spring-integration/activemq to receive from multiple destinations on the same thread?
If this is not possible, I can think of two alternatives:
Start my own processing thread which reads from a blocking queue, put all received messages on this queue.
Dispatch all received messages onto a single destination and consume from this.
Anyone have any better ideas?
Use the wildcard pattern on a single queue.
That is, instead of reading from two queues, use one queue and specify all queues you want to read from in the name.
that is: "QUEUE.NR1,QUEUE.NR2" or "SOME.PREFIX.>" to read all queues with that prefix. Your client code handle this as a single queue.

Azure queue message priority

I have a queue in Azure storage named for example 'messages'. And every 1 hour some service push to this queue some amount of messages that should update data. But, in some cases I also push to this queue message from another place and I want this message be proceeded immediately and I can not set priority for this message.
What is the best solution for this problem?
Can I use two different queues ('messages' and 'messages-priority') or it is a bad approach?
The correct approach is to use multiple queues - a 'normal priority' and a 'high priority' queue. What we have implemented is multiple queue reader threads in a single worker role - each thread first checks the high priority queue and, if its empty, looks in the normal queue. This way the high priority messages will be processed by the first available thread (pretty much immediately), and the same code runs regardless of where messages come from. It also saves having to have a reader continuously looking in a single queue and having to be backed off because there are seldom messages.

Spring/JMS listen to many destinations with one thread

I have a spring/JMS heavy application in which I have multiple listener containers each listening to a different topic or queue. I would like to reduce the number of threads I use to receive messages, and the number of threads I use to process messages for certain groups of queues/topics.
Is there any way to do this without using message selectors? I saw spring's DefaultMessageListenerContainer has a way to provide a task executor. However, the doc claims
'A plain thread pool does not add much
value, as this listener container will
occupy a number of threads for its
entire lifetime'
I don't really need JMS transactions, or really even care if I get multiple messages. Is there some way I can do this?
Check out activemq virtual destinations. They allow you to multiplex multiple destinations through a single receiver.
http://activemq.apache.org/virtual-destinations.html

Resources