首页 > 代码库 > ActiveMQ的receiveNoWait

ActiveMQ的receiveNoWait

Pending Queue Size ­ The number of messages in the queue that have yet to bedelivered to any clientDispatched Counter ­ The number of message in the queue that have beendelivered to a client, but not yet acknowledgedEnqueue Counter ­ The number of messages that have been sent to this queueDequeue Counter ­ the number of messages that have been consumed from thisqueue

pending messages = number of messages CURRENTLY waiting for delivery in the destination (the current size of the queue)

enqueued messages = number of messages that where enqueued in the destination since the last statistic reset. This number can only rise.

dequeued messages = messages delivered from the destination to consumers. this number can be higher that the number of enqueued messages if a message was delivered to multiple consumers (topics).

 

 

 

properties是否是配置文件,重启系统即可见效

 

 

Message selectors

 

session.createConsumer(destination, selector), selector用来确定consumer需要什么样的message, selector是string,使用jms selector syntax来确定需要的mesage

 

 

ConnectionFactory:connection is open tcp socket between client and provider, overhead is large, connection used by client to create Session

Destination:created by Session, unique to Connection. temporary destinations are used for request/reply messaging

 

transport connectors : client to broker

 

network connectors : brokers cluster, channels configured between brokers

forwarding bridge : 

 

 

 Messages sent to queues and topics are stored differently

 

storage for queues in FIFO, one message is dispatched to a consumer at a time, only acknowledged can be deleted from broker message store

 

 

topics‘ consumer get a copy of message, message can‘t be deleted until it‘s delivered to every subscriber

 

kahaDB

 

 

 

 

ActiveMQ的failover没有想象中那么智能,还是另起一个线程用于连接connection以保证万一broker不存在的话不会让获得验证码的线程处于堵塞状态